Skip to content

Commit f98035e

Browse files
fix: make PYTHONPATH test assertion repo-name agnostic (#44)
* fix: make PYTHONPATH test assertion repo-name agnostic The test was asserting that PYTHONPATH contains "archaeology" or "DEV-ARCH" — hardcoded local directory names. In CI the repo is cloned as "devarch-framework", so neither substring matched. Replace with an assertion that PYTHONPATH is an absolute path (which is the actual invariant the CLI code guarantees via Path(__file__).parent.parent). Fixes #39 * fix: use os.pathsep in PYTHONPATH test assertion
1 parent 4f5a2b1 commit f98035e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/test_cli_coverage.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,13 @@ def fake_run(cmd, **kwargs):
397397
assert db_builder_calls, "db.builder was never invoked"
398398
env = db_builder_calls[0]["env"]
399399
assert "PYTHONPATH" in env
400-
assert "archaeology" in env["PYTHONPATH"] or "DEV-ARCH" in env["PYTHONPATH"]
400+
# PYTHONPATH is set to the package root (Path(__file__).parent.parent)
401+
# which varies by checkout name — verify it's an absolute path containing
402+
# the archaeology package directory, not a hardcoded repo name.
403+
pp = env["PYTHONPATH"]
404+
assert os.path.isabs(pp.split(os.pathsep)[0]), (
405+
f"PYTHONPATH should start with an absolute path, got: {pp}"
406+
)
401407

402408

403409
# ── analyze (unknown vector) ──────────────────────────────────────────────────

0 commit comments

Comments
 (0)