From 064d879571a6db4bc96cf42d6154efd8316b11b4 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 21 Apr 2024 18:17:49 +0200 Subject: [PATCH] Ensure config tests remove the config file after deleting the object --- test/test_config.py | 2 +- test/test_profiles.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_config.py b/test/test_config.py index 48f9b9a32f..03b7c12398 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -47,7 +47,6 @@ def setUp(self): self.configpath = os.path.join(self.tmp_directory, 'test.ini') shutil.copy(os.path.join('test', 'data', 'test.ini'), self.configpath) - self.addCleanup(os.remove, self.configpath) self.config = Config.from_file(None, self.configpath) self.addCleanup(self.cleanup_config_obj) @@ -61,6 +60,7 @@ def cleanup_config_obj(self): self.config.sync() del self.config self.config = None + os.remove(self.configpath) class TestPicardConfig(TestPicardConfigCommon): diff --git a/test/test_profiles.py b/test/test_profiles.py index 7d6a0f0428..a6edb5c7b0 100644 --- a/test/test_profiles.py +++ b/test/test_profiles.py @@ -58,7 +58,6 @@ def setUp(self): self.configpath = os.path.join(self.tmp_directory, 'test.ini') shutil.copy(os.path.join('test', 'data', 'test.ini'), self.configpath) - self.addCleanup(os.remove, self.configpath) self.config = Config.from_file(None, self.configpath) self.addCleanup(self.cleanup_config_obj) @@ -94,6 +93,7 @@ def cleanup_config_obj(self): self.config.sync() del self.config self.config = None + os.remove(self.configpath) def get_profiles(self, enabled=True): profiles = []