From c0a8b98783953144a99686f2e5adfb8572492007 Mon Sep 17 00:00:00 2001 From: danielmeppiel Date: Mon, 19 Oct 2026 12:26:01 +0200 Subject: [PATCH] test: pin cwd for deep-coverage CLI fixtures The deep-coverage CLI tests passed the project via `obj={"cwd": ...}`, which no command reads, so `apm deps list` ran in whatever directory the xdist worker was left in. When an earlier test removed that directory, `deps list` exited 1 ("No such file or directory"), failing the v0.34.0 tag run on macOS arm64. The project fixtures now chdir into the project. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 761bf207-57da-41d0-bd3f-ffecbb97b83a --- tests/integration/test_commands_deep_coverage.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_commands_deep_coverage.py b/tests/integration/test_commands_deep_coverage.py index 9e520b7c49..2e0e907d2e 100644 --- a/tests/integration/test_commands_deep_coverage.py +++ b/tests/integration/test_commands_deep_coverage.py @@ -36,8 +36,10 @@ def runner() -> CliRunner: @pytest.fixture -def project_with_deps(tmp_path: Path) -> Path: +def project_with_deps(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: """Create a minimal but realistic APM project with dependencies.""" + # The CLI resolves the project from the process cwd, not ``obj["cwd"]``. + monkeypatch.chdir(tmp_path) # Create apm.yml apm_yml = tmp_path / "apm.yml" apm_yml.write_text( @@ -88,8 +90,10 @@ def project_with_deps(tmp_path: Path) -> Path: @pytest.fixture -def project_no_deps(tmp_path: Path) -> Path: +def project_no_deps(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: """Create a minimal APM project with no dependencies.""" + # The CLI resolves the project from the process cwd, not ``obj["cwd"]``. + monkeypatch.chdir(tmp_path) apm_yml = tmp_path / "apm.yml" apm_yml.write_text( "name: test-project\n"