mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +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:
|
||||
def cleanup(self):
|
||||
for f in self.module._cleanups:
|
||||
f()
|
||||
|
||||
def setUp(self):
|
||||
sys.modules['typing'] = self.module
|
||||
|
||||
def tearDown(self):
|
||||
self.cleanup()
|
||||
sys.modules['typing'] = typing
|
||||
|
||||
def test_basic(self):
|
||||
|
@ -3738,12 +3743,12 @@ class NewTypeTests:
|
|||
|
||||
self.assertEqual(repr(UserId), f'{__name__}.UserId')
|
||||
|
||||
class NewTypePythonTests(BaseTestCase, NewTypeTests):
|
||||
class NewTypePythonTests(NewTypeTests, BaseTestCase):
|
||||
module = py_typing
|
||||
|
||||
|
||||
@skipUnless(c_typing, 'requires _typing')
|
||||
class NewTypeCTests(BaseTestCase, NewTypeTests):
|
||||
class NewTypeCTests(NewTypeTests, BaseTestCase):
|
||||
module = c_typing
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue