We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b204ab commit 2e2fe26Copy full SHA for 2e2fe26
Lib/test/test_gc.py
@@ -1524,6 +1524,20 @@ def test_indirect_calls_with_gc_disabled(self):
1524
finally:
1525
gc.enable()
1526
1527
+ # Ensure that setting *threshold0* to zero disables collection.
1528
+ @gc_threshold(0)
1529
+ def test_threshold_zero(self):
1530
+ junk = []
1531
+ i = 0
1532
+ detector = GC_Detector()
1533
+ while not detector.gc_happened:
1534
+ i += 1
1535
+ if i > 50000:
1536
+ break
1537
+ junk.append([]) # this may eventually trigger gc (if it is enabled)
1538
+
1539
+ self.assertEqual(i, 50001)
1540
1541
1542
class PythonFinalizationTests(unittest.TestCase):
1543
def test_ast_fini(self):
0 commit comments