tempus-ddb 0.5.3

Local-first B2A security gate with tamper-evident execution receipts
Documentation
"""Test fixtures that remain reliable on restricted Windows workspaces."""

import gc
import shutil
from pathlib import Path
from uuid import uuid4

import pytest


@pytest.fixture
def tmp_path(request):
    """Create test directories without pytest's Windows-only 0o700 ACL issue."""
    root = Path.cwd() / "scratch" / "pytest-managed"
    root.mkdir(parents=True, exist_ok=True)
    path = root / f"{request.node.name}-{uuid4().hex}"
    path.mkdir()
    try:
        yield path
    finally:
        gc.collect()
        shutil.rmtree(path, ignore_errors=True)
        try:
            root.rmdir()
            root.parent.rmdir()
        except OSError:
            # Parallel or still-open test resources may keep the shared root alive.
            pass