mirror of https://github.com/python/cpython
fix this test to actually test something (closes #13606)
Thanks Mark Shannon.
This commit is contained in:
parent
57c9c7b755
commit
ca81bf76e5
|
@ -70,9 +70,11 @@ class ModuleTests(unittest.TestCase):
|
||||||
m = ModuleType("foo")
|
m = ModuleType("foo")
|
||||||
m.destroyed = destroyed
|
m.destroyed = destroyed
|
||||||
s = """class A:
|
s = """class A:
|
||||||
|
def __init__(self, l):
|
||||||
|
self.l = l
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
destroyed.append(1)
|
self.l.append(1)
|
||||||
a = A()"""
|
a = A(destroyed)"""
|
||||||
exec(s, m.__dict__)
|
exec(s, m.__dict__)
|
||||||
del m
|
del m
|
||||||
gc_collect()
|
gc_collect()
|
||||||
|
|
Loading…
Reference in New Issue