Skip to content

Commit 2da2560

Browse files
committed
tests: add missing test cleanup
skip_kernel_validation_patch was not stopped, and keeps reference to some objects. This also requires setUp() being called consistently - fix this one in rpc_import tests.
1 parent 125cb5a commit 2da2560

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

qubes/tests/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ def kernel_validator_patched(obj, key, value):
532532
)
533533
self.skip_kernel_validation_patch.start()
534534

535+
def tearDown(self):
536+
self.skip_kernel_validation_patch.stop()
537+
super().tearDown()
538+
535539
def cleanup_gc(self):
536540
# remove cached references to Qubes() object
537541
qubes.api.internal.SystemInfoCache.cache_for_app = None

qubes/tests/rpc_import.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class TestRpcImport(qubes.tests.QubesTestCase):
6969
)
7070

7171
def setUp(self):
72+
super().setUp()
7273
self.tmpdir = tempfile.mkdtemp()
7374
self.addCleanup(shutil.rmtree, self.tmpdir)
7475
with open(

0 commit comments

Comments
 (0)