diff options
author | 2022-11-28 09:44:11 +0800 | |
---|---|---|
committer | 2022-11-28 09:44:11 +0800 | |
commit | f4494c307eb5cf4200fd678dff90f1c2b5a5775e (patch) | |
tree | d189fc77f85c58a01ac4fc5f3061671a4fb3e37b | |
parent | Switch null byte test to use eval_code (diff) |
Add cleanup for LibMountTests
-rw-r--r-- | tests/test_libmount.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_libmount.py b/tests/test_libmount.py index a9a5e5b..7d02d1a 100644 --- a/tests/test_libmount.py +++ b/tests/test_libmount.py @@ -1,6 +1,7 @@ from concurrent.futures import ThreadPoolExecutor from contextlib import contextmanager, suppress from pathlib import Path +from shutil import rmtree from unittest import TestCase from uuid import uuid4 @@ -8,10 +9,15 @@ from snekbox import libmount class LibMountTests(TestCase): - def setUp(self): - self.temp_dir = Path("/tmp/snekbox-test") - self.temp_dir.mkdir(exist_ok=True, parents=True) - super().setUp() + temp_dir = Path("/tmp/snekbox") + + @classmethod + def setUpClass(cls): + cls.temp_dir.mkdir(exist_ok=True, parents=True) + + @classmethod + def tearDownClass(cls): + rmtree(cls.temp_dir, ignore_errors=True) @contextmanager def get_mount(self): |