Skip to content

Commit

Permalink
greentest.py: do gc.collect() x 3
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Apr 29, 2014
1 parent bc07ab4 commit fc195a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions greentest/greentest.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ def wrap_refcount(method):

@wraps(method)
def wrapped(self, *args, **kwargs):
import gc
gc.disable()
gc.collect()
gc.collect()
gc.collect()
deltas = []
d = None
gc.disable()
try:
while True:
d = gettotalrefcount()
Expand Down Expand Up @@ -131,7 +132,6 @@ def wrapped(self, *args, **kwargs):
if len(deltas) >= limit:
raise AssertionError('refcount increased by %r' % (deltas, ))
finally:
gc.collect()
gc.enable()
self.skipTearDown = True

Expand Down

0 comments on commit fc195a8

Please sign in to comment.