From bb5fca1a45fc5598464bd86611e31d9d2b4d8233 Mon Sep 17 00:00:00 2001 From: Pastorsimon1798 Date: Tue, 26 May 2026 21:27:39 -0700 Subject: [PATCH 1/2] fix: make PYTHONPATH test assertion repo-name agnostic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/test_cli_coverage.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_cli_coverage.py b/tests/test_cli_coverage.py index a5d687c..8fce5bd 100644 --- a/tests/test_cli_coverage.py +++ b/tests/test_cli_coverage.py @@ -397,7 +397,13 @@ def fake_run(cmd, **kwargs): assert db_builder_calls, "db.builder was never invoked" env = db_builder_calls[0]["env"] assert "PYTHONPATH" in env - assert "archaeology" in env["PYTHONPATH"] or "DEV-ARCH" in env["PYTHONPATH"] + # PYTHONPATH is set to the package root (Path(__file__).parent.parent) + # which varies by checkout name — verify it's an absolute path containing + # the archaeology package directory, not a hardcoded repo name. + pp = env["PYTHONPATH"] + assert os.path.isabs(pp.split(":")[0].split(";")[0]), ( + f"PYTHONPATH should start with an absolute path, got: {pp}" + ) # ── analyze (unknown vector) ────────────────────────────────────────────────── From e9fa64e84b97db739568b4491b2812d31a610f0d Mon Sep 17 00:00:00 2001 From: Pastorsimon1798 Date: Wed, 27 May 2026 00:29:25 -0700 Subject: [PATCH 2/2] fix: use os.pathsep in PYTHONPATH test assertion --- tests/test_cli_coverage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cli_coverage.py b/tests/test_cli_coverage.py index 8fce5bd..fc7720a 100644 --- a/tests/test_cli_coverage.py +++ b/tests/test_cli_coverage.py @@ -401,7 +401,7 @@ def fake_run(cmd, **kwargs): # which varies by checkout name — verify it's an absolute path containing # the archaeology package directory, not a hardcoded repo name. pp = env["PYTHONPATH"] - assert os.path.isabs(pp.split(":")[0].split(";")[0]), ( + assert os.path.isabs(pp.split(os.pathsep)[0]), ( f"PYTHONPATH should start with an absolute path, got: {pp}" )