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 d7dc6bf commit 3d4cf3bCopy full SHA for 3d4cf3b
Lib/test/test_gc.py
@@ -1501,6 +1501,20 @@ def test_indirect_calls_with_gc_disabled(self):
1501
finally:
1502
gc.enable()
1503
1504
+ # Ensure that setting *threshold0* to zero disables collection.
1505
+ @gc_threshold(0)
1506
+ def test_threshold_zero(self):
1507
+ junk = []
1508
+ i = 0
1509
+ detector = GC_Detector()
1510
+ while not detector.gc_happened:
1511
+ i += 1
1512
+ if i > 50000:
1513
+ break
1514
+ junk.append([]) # this may eventually trigger gc (if it is enabled)
1515
+
1516
+ self.assertEqual(i, 50001)
1517
1518
1519
class PythonFinalizationTests(unittest.TestCase):
1520
def test_ast_fini(self):
0 commit comments