Skip to content
Myr

Always run gc before leak test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent c810fae · Browse files · 1 file+1 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−2 removed

  • tests:+1 added−2 removed

1 file+1 added−2 removed

modified:tests/test_regression.py+1 added-2 removed
37 unmodified lines
38 gc.collect()39 self.old_objects = len(gc.get_objects())4041 def __exit__(self, exc_type, exc_value, tb):42 if not hasattr(sys, 'getrefcount'):43 gc.collect()42 gc.collect()43 new_objects = len(gc.get_objects())44 if new_objects > self.old_objects:45 pytest.fail('Example code leaked')46 _gc_lock.release()
56 unmodified lines