22 lines
587 B
Python
22 lines
587 B
Python
import atexit
|
|
import os
|
|
import shutil
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
TEST_ROOT = Path(tempfile.mkdtemp(prefix="wov-api-test-"))
|
|
os.environ["WOV_DATA_DIR"] = str(TEST_ROOT / "data")
|
|
os.environ["WOV_DB_PATH"] = str(TEST_ROOT / "data" / "wov.db")
|
|
os.environ["WOV_STORAGE_DIR"] = str(TEST_ROOT / "storage")
|
|
os.environ["WOV_REAP_INTERVAL_SECONDS"] = "0.1"
|
|
os.environ["WOV_READY_TIMEOUT_SECONDS"] = "2"
|
|
os.environ["WOV_AUTO_SEED"] = "0"
|
|
os.environ["WOV_SCHEDULER_ENABLED"] = "0"
|
|
|
|
|
|
def _cleanup() -> None:
|
|
shutil.rmtree(TEST_ROOT, ignore_errors=True)
|
|
|
|
|
|
atexit.register(_cleanup)
|