summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gc.py
diff options
context:
space:
mode:
authorVladimir Marangozov <vladimir.marangozov@t-online.de>2000-08-06 22:45:31 (GMT)
committerVladimir Marangozov <vladimir.marangozov@t-online.de>2000-08-06 22:45:31 (GMT)
commitf9d20c37864316e0cd343e0b9bbac638a7590ad5 (patch)
tree6feeeca35f8e45047d6a60601cdb1f0fcad7ea25 /Lib/test/test_gc.py
parent5bcb215e6e2137048a809c0411d950886ea3b0cb (diff)
downloadcpython-f9d20c37864316e0cd343e0b9bbac638a7590ad5.zip
cpython-f9d20c37864316e0cd343e0b9bbac638a7590ad5.tar.gz
cpython-f9d20c37864316e0cd343e0b9bbac638a7590ad5.tar.bz2
Neil Schemenauer: GC enable(), disable(), isenabled() interface.
Small stylistic changes by VM: - is_enabled() -> isenabled() - static ... Py_<func> -> static ... gc_<func>
Diffstat (limited to 'Lib/test/test_gc.py')
-rw-r--r--Lib/test/test_gc.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 943f837..7f8e424 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -75,6 +75,11 @@ def test_function():
def test_all():
+
+ enabled = gc.isenabled()
+ gc.disable()
+ assert not gc.isenabled()
+
test_list()
test_dict()
test_tuple()
@@ -84,4 +89,11 @@ def test_all():
test_finalizer()
test_function()
+ # test gc.enable() even if GC is disabled by default
+ gc.enable()
+ assert gc.isenabled()
+ if not enabled:
+ gc.disable()
+
+
test_all()