aboutsummaryrefslogtreecommitdiff
path: root/lib/project/tests/conftest.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-12 21:18:34 -0400
committerhistoria <historiavg@proton.me>2026-09-12 21:18:34 -0400
commit544134f0534d2e4e4fd7ab823d8a0da543fa80ef (patch)
treeef0f787b6377608b3814ac642804e8c778980ddf /lib/project/tests/conftest.py
parent0cd53b67793e74e8be0201b90711cb51b7186d6e (diff)
downloadproducer-544134f0534d2e4e4fd7ab823d8a0da543fa80ef.tar.gz
fix: output wavs from gui go into correct directory
Diffstat (limited to 'lib/project/tests/conftest.py')
-rw-r--r--lib/project/tests/conftest.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/project/tests/conftest.py b/lib/project/tests/conftest.py
index 0155384..9cde05f 100644
--- a/lib/project/tests/conftest.py
+++ b/lib/project/tests/conftest.py
@@ -12,6 +12,31 @@ from producer.config import resolve
from producer.setup import ensure_ffmpeg
+@pytest.fixture(autouse=True)
+def producer_root(tmp_path, monkeypatch):
+ """Isolated shared logs directory for every test: report logs always go
+ under <PRODUCER_ROOT>/logs."""
+ root = tmp_path / "producer-root"
+ monkeypatch.setenv("PRODUCER_ROOT", str(root))
+ return root
+
+
+@pytest.fixture
+def logs(producer_root):
+ return producer_root / "logs"
+
+
+@pytest.fixture
+def report_of(logs):
+ """Locate the one published report for an audio destination; report names
+ are timestamped, so tests glob by stem."""
+ def find(target):
+ matches = sorted(logs.glob(f"{target.stem}.*.report.json"))
+ assert len(matches) == 1, matches
+ return matches[0]
+ return find
+
+
@pytest.fixture
def progress():
return lambda *_: None