summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gc.py
diff options
context:
space:
mode:
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()