from __future__ import annotations from pathlib import Path from uuid import uuid4 ROOT = Path(__file__).resolve().parents[1] TMP_ROOT = ROOT / ".test-tmp" def make_tmp() -> Path: TMP_ROOT.mkdir(parents=True, exist_ok=True) path = TMP_ROOT / uuid4().hex path.mkdir(parents=True, exist_ok=False) return path