◐ Shell
clean mode source ↗

[3.10] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005). by serhiy-storchaka · Pull Request #28027 · python/cpython

Expand Up @@ -656,6 +656,7 @@ def inner_raising_func(): except MyException as e: pass obj = None gc_collect() # For PyPy or other GCs. obj = wr() self.assertIsNone(obj)
Expand All @@ -667,6 +668,7 @@ def inner_raising_func(): except MyException: pass obj = None gc_collect() # For PyPy or other GCs. obj = wr() self.assertIsNone(obj)
Expand All @@ -678,6 +680,7 @@ def inner_raising_func(): except: pass obj = None gc_collect() # For PyPy or other GCs. obj = wr() self.assertIsNone(obj)
Expand All @@ -690,6 +693,7 @@ def inner_raising_func(): except: break obj = None gc_collect() # For PyPy or other GCs. obj = wr() self.assertIsNone(obj)
Expand All @@ -708,6 +712,7 @@ def inner_raising_func(): # must clear the latter manually for our test to succeed. e.__context__ = None obj = None gc_collect() # For PyPy or other GCs. obj = wr() # guarantee no ref cycles on CPython (don't gc_collect) if check_impl_detail(cpython=False): Expand Down Expand Up @@ -898,6 +903,7 @@ def raising_gen(): next(g) testfunc(g) g = obj = None gc_collect() # For PyPy or other GCs. obj = wr() self.assertIsNone(obj)
Expand Down Expand Up @@ -951,6 +957,7 @@ def __del__(self): raise Exception(MyObject()) except: pass gc_collect() # For PyPy or other GCs. self.assertEqual(e, (None, None, None))
def test_raise_does_not_create_context_chain_cycle(self): Expand Down Expand Up @@ -1413,6 +1420,7 @@ def inner(): self.assertNotEqual(wr(), None) else: self.fail("MemoryError not raised") gc_collect() # For PyPy or other GCs. self.assertEqual(wr(), None)
@no_tracing Expand All @@ -1433,6 +1441,7 @@ def inner(): self.assertNotEqual(wr(), None) else: self.fail("RecursionError not raised") gc_collect() # For PyPy or other GCs. self.assertEqual(wr(), None)
def test_errno_ENOTDIR(self): Expand All @@ -1453,6 +1462,7 @@ def __del__(self): with support.catch_unraisable_exception() as cm: del obj
gc_collect() # For PyPy or other GCs. self.assertEqual(cm.unraisable.object, BrokenDel.__del__) self.assertIsNotNone(cm.unraisable.exc_traceback)
Expand Down