aboutsummaryrefslogtreecommitdiffziptar.gz
path: root/tests/__init__.py
diff options
context:
space:
mode:
authorgodosa <godosa@godosa.eu>2026-10-06 23:52:03 +0200
committergodosa <godosa@godosa.eu>2026-10-06 23:52:03 +0200
commit346b1c5195bffc71ceaa9262453e3c189656400b (patch)
tree01ac0d31e2724cd6abcc689a5a228e2cbea2f6cf /tests/__init__.py
downloadworldgen-346b1c5195bffc71ceaa9262453e3c189656400b.tar.gz
worldgen-346b1c5195bffc71ceaa9262453e3c189656400b.zip
worldgen: initial public history
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..ccdaff7
--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,10 @@
+import atexit
+import os
+import shutil
+import tempfile
+
+if "WORLDGEN_TEST_TMP" not in os.environ:
+ _root = tempfile.mkdtemp(prefix="worldgen-tests-")
+ os.environ["WORLDGEN_TEST_TMP"] = os.environ["TMPDIR"] = tempfile.tempdir = _root
+ _pid = os.getpid()
+ atexit.register(lambda: os.getpid() == _pid and shutil.rmtree(_root, True))