Test GC of frame objects.
This commit is contained in:
parent
28358fbed6
commit
88c761a117
|
@ -1,4 +1,5 @@
|
|||
from test_support import verify, verbose, TestFailed
|
||||
import sys
|
||||
import gc
|
||||
|
||||
def run_test(name, thunk):
|
||||
|
@ -107,6 +108,15 @@ def test_function():
|
|||
if gc.collect() != 2:
|
||||
raise TestFailed
|
||||
|
||||
def test_frame():
|
||||
def f():
|
||||
frame = sys._getframe()
|
||||
gc.collect()
|
||||
f()
|
||||
if gc.collect() != 1:
|
||||
raise TestFailed
|
||||
|
||||
|
||||
def test_saveall():
|
||||
# Verify that cyclic garbage like lists show up in gc.garbage if the
|
||||
# SAVEALL option is enabled.
|
||||
|
@ -152,6 +162,7 @@ def test_all():
|
|||
run_test("instances", test_instance)
|
||||
run_test("methods", test_method)
|
||||
run_test("functions", test_function)
|
||||
run_test("frames", test_frame)
|
||||
run_test("finalizers", test_finalizer)
|
||||
run_test("__del__", test_del)
|
||||
run_test("saveall", test_saveall)
|
||||
|
|
Loading…
Reference in New Issue