"""Tests for the per-run workspace path (workspace_path_finalize_20260609).""" import subprocess from pathlib import Path def test_live_gui_workspace_is_under_tests_artifacts(live_gui_workspace: Path) -> None: """The live_gui_workspace fixture returns a path under tests/artifacts/.""" s = str(live_gui_workspace).replace("\\", "/") assert s.startswith("tests/artifacts/live_gui_workspace_"), f"Expected tests/artifacts/live_gui_workspace_*, got {s}" def test_live_gui_workspace_is_gitignored(live_gui_workspace: Path) -> None: """The live_gui_workspace path is gitignored (via tests/artifacts/ in .gitignore).""" result = subprocess.run( ["git", "check-ignore", str(live_gui_workspace)], capture_output=True, text=True, cwd="." ) assert result.returncode == 0, f"Workspace {live_gui_workspace} is not gitignored. git check-ignore output: {result.stdout!r} {result.stderr!r}"