Skip to content

Commit 2ea1a57

Browse files
committed
Suppress warnings raised for _clear_type_cache
1 parent aef2b2d commit 2ea1a57

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Lib/test/test_cmd_line.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,12 +932,14 @@ def test_python_asyncio_debug(self):
932932
self.assertIn(b'True', out)
933933

934934
@unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option")
935+
@support.ignore_warnings(category=DeprecationWarning)
935936
def test_python_dump_refs(self):
936937
code = 'import sys; sys._clear_type_cache()'
937938
rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1')
938939
self.assertEqual(rc, 0)
939940

940941
@unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option")
942+
@support.ignore_warnings(category=DeprecationWarning)
941943
def test_python_dump_refs_file(self):
942944
with tempfile.NamedTemporaryFile() as dump_file:
943945
code = 'import sys; sys._clear_type_cache()'

Lib/test/test_type_cache.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
@support.cpython_only
2121
@unittest.skipIf(_clear_type_cache is None, "requires sys._clear_type_cache")
2222
class TypeCacheTests(unittest.TestCase):
23+
@support.ignore_warnings(category=DeprecationWarning)
2324
def test_tp_version_tag_unique(self):
2425
"""tp_version_tag should be unique assuming no overflow, even after
2526
clearing type cache.
@@ -61,6 +62,7 @@ class C:
6162
self.assertNotEqual(type_get_version(C), 0)
6263
self.assertNotEqual(type_get_version(C), c_ver)
6364

65+
@support.ignore_warnings(category=DeprecationWarning)
6466
def test_type_assign_specific_version(self):
6567
"""meta-test for type_assign_specific_version_unsafe"""
6668
class C:
@@ -111,6 +113,8 @@ class HolderSub(Holder):
111113

112114
@support.cpython_only
113115
class TypeCacheWithSpecializationTests(unittest.TestCase):
116+
117+
@support.ignore_warnings(category=DeprecationWarning)
114118
def tearDown(self):
115119
_clear_type_cache()
116120

0 commit comments

Comments
 (0)