|  | 
| 2 | 2 | import unittest | 
| 3 | 3 | import dis | 
| 4 | 4 | from test import support | 
| 5 |  | -from test.support import import_helper, requires_specialization, requires_specialization_ft | 
|  | 5 | +from test.support import ( | 
|  | 6 | +    import_helper, requires_specialization, | 
|  | 7 | +    requires_specialization_ft, warnings_helper | 
|  | 8 | +) | 
| 6 | 9 | try: | 
| 7 | 10 |     from sys import _clear_type_cache | 
| 8 | 11 | except ImportError: | 
|  | 
| 15 | 18 | type_assign_specific_version_unsafe = _testinternalcapi.type_assign_specific_version_unsafe | 
| 16 | 19 | type_assign_version = _testcapi.type_assign_version | 
| 17 | 20 | type_modified = _testcapi.type_modified | 
|  | 21 | +ignore_deprecation = warnings_helper.ignore_warnings(category=DeprecationWarning) | 
| 18 | 22 | 
 | 
| 19 | 23 | 
 | 
| 20 | 24 | @support.cpython_only | 
| 21 | 25 | @unittest.skipIf(_clear_type_cache is None, "requires sys._clear_type_cache") | 
| 22 | 26 | class TypeCacheTests(unittest.TestCase): | 
|  | 27 | +    @ignore_deprecation | 
| 23 | 28 |     def test_tp_version_tag_unique(self): | 
| 24 | 29 |         """tp_version_tag should be unique assuming no overflow, even after | 
| 25 | 30 |         clearing type cache. | 
| @@ -61,6 +66,7 @@ class C: | 
| 61 | 66 |         self.assertNotEqual(type_get_version(C), 0) | 
| 62 | 67 |         self.assertNotEqual(type_get_version(C), c_ver) | 
| 63 | 68 | 
 | 
|  | 69 | +    @ignore_deprecation | 
| 64 | 70 |     def test_type_assign_specific_version(self): | 
| 65 | 71 |         """meta-test for type_assign_specific_version_unsafe""" | 
| 66 | 72 |         class C: | 
| @@ -111,6 +117,8 @@ class HolderSub(Holder): | 
| 111 | 117 | 
 | 
| 112 | 118 | @support.cpython_only | 
| 113 | 119 | class TypeCacheWithSpecializationTests(unittest.TestCase): | 
|  | 120 | + | 
|  | 121 | +    @ignore_deprecation | 
| 114 | 122 |     def tearDown(self): | 
| 115 | 123 |         _clear_type_cache() | 
| 116 | 124 | 
 | 
|  | 
0 commit comments