tests: do not leak objects in object leaks checking function

If any object is leaked, QubesTestCase.cleanup_gc() raises an exception,
which have leaked objects list referenced in its traceback. This happens
after cleanup_traceback(), so isn't cleaned, causing cleanup_gc() fail
for all the further tests in the same test run.

Avoid this, by dropping list just before checking if any object is
leaked.
This commit is contained in:
Marek Marczykowski-Górecki 2018-09-29 02:40:43 +02:00
parent b88fa39894
commit 5bc0baeafa
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -409,6 +409,8 @@ class QubesTestCase(unittest.TestCase):
except ImportError:
pass
# do not keep leaked object references in locals()
leaked = bool(leaked)
assert not leaked
def cleanup_loop(self):