Commit fc195a83 authored by Denis Bilenko's avatar Denis Bilenko

greentest.py: do gc.collect() x 3

parent bc07ab4e
...@@ -90,11 +90,12 @@ def wrap_refcount(method): ...@@ -90,11 +90,12 @@ def wrap_refcount(method):
@wraps(method) @wraps(method)
def wrapped(self, *args, **kwargs): def wrapped(self, *args, **kwargs):
import gc gc.collect()
gc.disable() gc.collect()
gc.collect() gc.collect()
deltas = [] deltas = []
d = None d = None
gc.disable()
try: try:
while True: while True:
d = gettotalrefcount() d = gettotalrefcount()
...@@ -131,7 +132,6 @@ def wrap_refcount(method): ...@@ -131,7 +132,6 @@ def wrap_refcount(method):
if len(deltas) >= limit: if len(deltas) >= limit:
raise AssertionError('refcount increased by %r' % (deltas, )) raise AssertionError('refcount increased by %r' % (deltas, ))
finally: finally:
gc.collect()
gc.enable() gc.enable()
self.skipTearDown = True self.skipTearDown = True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment