"""Atlas-owned fixtures (never refreshed by the scaffolder).

The comments store writes under the data dir; wipe it per test so threads never
leak between tests. Star-import skips underscore names, so `__all__` lists the
autouse fixture explicitly (a documented kit gotcha)."""

import shutil

import pytest

from app.config import get_settings

__all__ = ["_fresh_comments"]


@pytest.fixture(autouse=True)
def _fresh_comments():
    folder = get_settings().data_dir / "comments"
    shutil.rmtree(folder, ignore_errors=True)
    yield
    shutil.rmtree(folder, ignore_errors=True)
