Commit 72664a4c authored by Denis Bilenko's avatar Denis Bilenko

greentest: do not call tearDown() multiple times

parent 5ee4e82a
......@@ -101,6 +101,7 @@ def wrap_refcount(method):
finally:
gc.collect()
gc.enable()
self.skipTearDown = True
return wrapped
......@@ -187,6 +188,8 @@ class TestCase(BaseTestCase):
self.initial_switch_count = getattr(_get_hub(), 'switch_count', None)
def tearDown(self):
if getattr(self, 'skipTearDown', False):
return
if hasattr(self, 'cleanup'):
self.cleanup()
if self.switch_count is not None:
......
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