diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
| commit | 3443c1c65e9f1753e1e656b35d08416c1fa298f2 (patch) | |
| tree | 4e43236f460145a4d75d1b4616dcb7aa6ef08f51 /tests/__init__.py | |
| download | worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.tar.gz worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.zip | |
worldmap-viewer: initial public history
Diffstat (limited to 'tests/__init__.py')
| -rw-r--r-- | tests/__init__.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..c17e6de --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,15 @@ +import atexit +import os +import shutil +import sys +import tempfile +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +import worldgen_path # noqa: E402,F401 (mapgen on sys.path) + +if "WORLDMAP_TEST_TMP" not in os.environ: + _root = tempfile.mkdtemp(prefix="worldmap-viewer-tests-") + os.environ["WORLDMAP_TEST_TMP"] = os.environ["TMPDIR"] = tempfile.tempdir = _root + _pid = os.getpid() + atexit.register(lambda: os.getpid() == _pid and shutil.rmtree(_root, True)) |
