summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_archive.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-12-31 10:01:31 +0100
committerGitHub <noreply@github.com>2023-12-31 10:01:31 +0100
commitd88ec42bd0a37340c8477a6f20bf26e58bd84735 (patch)
treeabd9422f7fb34a19579a74515ce84d9f472cd226 /tests/utils_tests/test_archive.py
parent81ccf92f154c6d9eac3e30bac0aa67574d0ace15 (diff)
Used addCleanup() in tests where appropriate.
Diffstat (limited to 'tests/utils_tests/test_archive.py')
-rw-r--r--tests/utils_tests/test_archive.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/utils_tests/test_archive.py b/tests/utils_tests/test_archive.py
index 8cd107063f..89a45bc072 100644
--- a/tests/utils_tests/test_archive.py
+++ b/tests/utils_tests/test_archive.py
@@ -26,11 +26,9 @@ except ImportError:
class TestArchive(unittest.TestCase):
def setUp(self):
self.testdir = os.path.join(os.path.dirname(__file__), "archives")
- self.old_cwd = os.getcwd()
+ old_cwd = os.getcwd()
os.chdir(self.testdir)
-
- def tearDown(self):
- os.chdir(self.old_cwd)
+ self.addCleanup(os.chdir, old_cwd)
def test_extract_function(self):
with os.scandir(self.testdir) as entries: