From 22c653a7179f97e4f7c4de391f9204d71f4fb6c7 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Fri, 24 Mar 2023 22:55:32 +0100 Subject: Register cleanup job after module load --- pydis_site/apps/content/tests/helpers.py | 6 +----- 1 file changed, 1 insertion(+), 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) -- cgit v1.2.3