Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions qubes/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ def kernel_validator_patched(obj, key, value):
)
self.skip_kernel_validation_patch.start()

def tearDown(self):
self.skip_kernel_validation_patch.stop()
super().tearDown()

def cleanup_gc(self):
# remove cached references to Qubes() object
qubes.api.internal.SystemInfoCache.cache_for_app = None
Expand Down Expand Up @@ -953,6 +957,12 @@ def cleanup_app(self):
obj_type = type(getattr(self, attr))
if obj_type.__module__.startswith("qubes"):
delattr(self, attr)
elif issubclass(obj_type, list) and any(
type(obj).__module__.startswith("qubes")
for obj in getattr(self, attr)
):
# remove also list of qubes objects
delattr(self, attr)

# then trigger garbage collector to really destroy those objects
gc.collect()
Expand Down
1 change: 1 addition & 0 deletions qubes/tests/rpc_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class TestRpcImport(qubes.tests.QubesTestCase):
)

def setUp(self):
super().setUp()
self.tmpdir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.tmpdir)
with open(
Expand Down