aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2023-03-24 22:55:32 +0100
committerGravatar Johannes Christ <[email protected]>2023-03-25 22:47:13 +0100
commit22c653a7179f97e4f7c4de391f9204d71f4fb6c7 (patch)
tree56f1cabd9c0de754aad9feffc2c4d32ee0508221
parentDrop dependency to pyfakefs (diff)
Register cleanup job after module load
-rw-r--r--pydis_site/apps/content/tests/helpers.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/pydis_site/apps/content/tests/helpers.py b/pydis_site/apps/content/tests/helpers.py
index 1eab62be..fad91050 100644
--- a/pydis_site/apps/content/tests/helpers.py
+++ b/pydis_site/apps/content/tests/helpers.py
@@ -7,6 +7,7 @@ from django.test import TestCase
BASE_PATH = Path(tempfile.mkdtemp(prefix='pydis-site-content-app-tests-'))
+atexit.register(shutil.rmtree, BASE_PATH, ignore_errors=True)
# Valid markdown content with YAML metadata
@@ -99,8 +100,3 @@ class MockPagesTestCase(TestCase):
Path(f"{temp}/category").mkdir(exist_ok=True)
Path(f"{temp}/category/_info.yml").write_text(CATEGORY_INFO)
Path(f"{temp}/category/subcategory_without_info").mkdir(exist_ok=True)
-
- @classmethod
- def setUpTestData(cls):
- # May get called multiple times - ignore erorrs in that case.
- atexit.register(shutil.rmtree, BASE_PATH, ignore_errors=True)