Skip to content

Commit

Permalink
Ensure config tests remove the config file after deleting the object
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Apr 30, 2024
1 parent df7036a commit 064d879
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion test/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit 064d879

Please sign in to comment.