Thanks to visit codestin.com Credit goes to github.com
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 a615fb4 commit 5d0abb6Copy full SHA for 5d0abb6
1 file changed
Lib/test/test_gc.py
@@ -1559,6 +1559,20 @@ def test_indirect_calls_with_gc_disabled(self):
1559
finally:
1560
gc.enable()
1561
1562
+ # Ensure that setting *threshold0* to zero disables collection.
1563
+ @gc_threshold(0)
1564
+ def test_threshold_zero(self):
1565
+ junk = []
1566
+ i = 0
1567
+ detector = GC_Detector()
1568
+ while not detector.gc_happened:
1569
+ i += 1
1570
+ if i > 50000:
1571
+ break
1572
+ junk.append([]) # this may eventually trigger gc (if it is enabled)
1573
+
1574
+ self.assertEqual(i, 50001)
1575
1576
1577
class PythonFinalizationTests(unittest.TestCase):
1578
def test_ast_fini(self):
0 commit comments