From 346b1c5195bffc71ceaa9262453e3c189656400b Mon Sep 17 00:00:00 2001 From: godosa Date: Tue, 6 Oct 2026 23:52:03 +0200 Subject: worldgen: initial public history --- tests/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/__init__.py (limited to 'tests/__init__.py') 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)) -- cgit