Skip to content

Commit db050da

Browse files
committed
Update import path
1 parent 2ea1a57 commit db050da

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Lib/test/test_type_cache.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
import unittest
33
import dis
44
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+
)
69
try:
710
from sys import _clear_type_cache
811
except ImportError:
@@ -15,12 +18,15 @@
1518
type_assign_specific_version_unsafe = _testinternalcapi.type_assign_specific_version_unsafe
1619
type_assign_version = _testcapi.type_assign_version
1720
type_modified = _testcapi.type_modified
21+
ignore_deprecation = warnings_helper.ignore_warnings(
22+
category=DeprecationWarning
23+
)
1824

1925

2026
@support.cpython_only
2127
@unittest.skipIf(_clear_type_cache is None, "requires sys._clear_type_cache")
2228
class TypeCacheTests(unittest.TestCase):
23-
@support.ignore_warnings(category=DeprecationWarning)
29+
@ignore_deprecation
2430
def test_tp_version_tag_unique(self):
2531
"""tp_version_tag should be unique assuming no overflow, even after
2632
clearing type cache.
@@ -62,7 +68,7 @@ class C:
6268
self.assertNotEqual(type_get_version(C), 0)
6369
self.assertNotEqual(type_get_version(C), c_ver)
6470

65-
@support.ignore_warnings(category=DeprecationWarning)
71+
@ignore_deprecation
6672
def test_type_assign_specific_version(self):
6773
"""meta-test for type_assign_specific_version_unsafe"""
6874
class C:
@@ -114,7 +120,7 @@ class HolderSub(Holder):
114120
@support.cpython_only
115121
class TypeCacheWithSpecializationTests(unittest.TestCase):
116122

117-
@support.ignore_warnings(category=DeprecationWarning)
123+
@ignore_deprecation
118124
def tearDown(self):
119125
_clear_type_cache()
120126

0 commit comments

Comments
 (0)