mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-44353: Fix memory leak introduced by GH-27262 (GH-27305)
This commit is contained in:
parent
906fe47083
commit
8f42106b5c
1 changed files with 7 additions and 2 deletions
|
@ -3692,10 +3692,15 @@ class TestModules(TestCase):
|
||||||
|
|
||||||
|
|
||||||
class NewTypeTests:
|
class NewTypeTests:
|
||||||
|
def cleanup(self):
|
||||||
|
for f in self.module._cleanups:
|
||||||
|
f()
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
sys.modules['typing'] = self.module
|
sys.modules['typing'] = self.module
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
self.cleanup()
|
||||||
sys.modules['typing'] = typing
|
sys.modules['typing'] = typing
|
||||||
|
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
|
@ -3738,12 +3743,12 @@ class NewTypeTests:
|
||||||
|
|
||||||
self.assertEqual(repr(UserId), f'{__name__}.UserId')
|
self.assertEqual(repr(UserId), f'{__name__}.UserId')
|
||||||
|
|
||||||
class NewTypePythonTests(BaseTestCase, NewTypeTests):
|
class NewTypePythonTests(NewTypeTests, BaseTestCase):
|
||||||
module = py_typing
|
module = py_typing
|
||||||
|
|
||||||
|
|
||||||
@skipUnless(c_typing, 'requires _typing')
|
@skipUnless(c_typing, 'requires _typing')
|
||||||
class NewTypeCTests(BaseTestCase, NewTypeTests):
|
class NewTypeCTests(NewTypeTests, BaseTestCase):
|
||||||
module = c_typing
|
module = c_typing
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue