From 130bd619cf4db958e2c73a2af078c9637a4394a0 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 5 Sep 2022 12:55:39 +0100 Subject: [PATCH] tests: journal_lock: Cleanup properly in `test_update_lock()` * As this involved two directories we also need to clean up the 'old' one. --- tests/journal_lock.py/test_journal_lock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/journal_lock.py/test_journal_lock.py b/tests/journal_lock.py/test_journal_lock.py index 8582f9df..eb100269 100644 --- a/tests/journal_lock.py/test_journal_lock.py +++ b/tests/journal_lock.py/test_journal_lock.py @@ -352,6 +352,7 @@ class TestJournalLock: # Now store the 'current' journaldir for reference and attempt # to update to a new one. old_journaldir = jlock.journal_dir + old_journaldir_lockfile_name = jlock.journal_dir_lockfile_name jlock.update_lock(None) # type: ignore assert jlock.journal_dir != old_journaldir assert jlock.locked @@ -359,6 +360,8 @@ class TestJournalLock: # Cleanup, to avoid side-effect on other tests assert jlock.release_lock() os.unlink(str(jlock.journal_dir_lockfile_name)) + # And the old_journaldir's lockfile too + os.unlink(str(old_journaldir_lockfile_name)) def test_update_lock_same(self, mock_journaldir: py_path_local_LocalPath): """