From 057d637080852774df41a086358d7e8cae2949b8 Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Mon, 3 Aug 2026 14:52:41 +0200 Subject: [PATCH] Fix test_write_submit_requires_synced_venv for active-venv resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The venv-detection change in condor.py now checks for a giant binary next to sys.executable before falling back to repo_dir/.venv/bin/giant, and the test's own pytest venv has one — so the expected FileNotFoundError never fired. Monkeypatch sys.executable to a nonexistent path so the test exercises the fallback with neither location populated. --- tests/test_condor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_condor.py b/tests/test_condor.py index 72c84ba..92139d2 100644 --- a/tests/test_condor.py +++ b/tests/test_condor.py @@ -2,6 +2,7 @@ from __future__ import annotations +import sys from pathlib import Path import pyarrow.parquet as pq @@ -223,9 +224,12 @@ def test_write_submit_description(tmp_path: Path): assert "--chunk" in body and "--run-dir" in body -def test_write_submit_requires_synced_venv(tmp_path: Path): +def test_write_submit_requires_synced_venv(tmp_path: Path, monkeypatch: pytest.MonkeyPatch): run_dir = _prep(_write_inputs(tmp_path)) cfg = SubmitConfig(run_dir=run_dir, accounting_group="cms", repo_dir=tmp_path) + # No `giant` next to the (fake) active interpreter, so this falls through + # to repo_dir/.venv/bin/giant, which _write_inputs/_prep also didn't create. + monkeypatch.setattr(sys, "executable", str(tmp_path / "not-a-venv" / "bin" / "python")) with pytest.raises(FileNotFoundError, match="uv sync"): write_submit(cfg)