Skip to content

Commit ab6cf05

Browse files
test fix: correct cli test after pytest 8 exposed a bug
1 parent fd82193 commit ab6cf05

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

testing/test_cli.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ def get_output(args: list[str]) -> str:
2323

2424

2525
warns_cli_root_override = pytest.warns(
26-
UserWarning, match="root .. is overridden by the cli arg ."
27-
)
28-
warns_absolute_root_override = pytest.warns(
29-
UserWarning, match="absolute root path '.*' overrides relative_to '.*'"
26+
UserWarning, match="root .. is overridden by the cli arg .*"
3027
)
3128

3229
exits_with_not_found = pytest.raises(SystemExit, match="no version found for")
@@ -35,11 +32,9 @@ def get_output(args: list[str]) -> str:
3532
def test_cli_find_pyproject(
3633
wd: WorkDir, monkeypatch: pytest.MonkeyPatch, debug_mode: DebugMode
3734
) -> None:
38-
debug_mode.disable()
3935
wd.commit_testfile()
4036
wd.write(PYPROJECT_TOML, PYPROJECT_SIMPLE)
4137
monkeypatch.chdir(wd.cwd)
42-
4338
out = get_output([])
4439
assert out.startswith("0.1.dev1+")
4540

@@ -50,7 +45,7 @@ def test_cli_find_pyproject(
5045
with exits_with_not_found:
5146
print(get_output(["-c", PYPROJECT_TOML]))
5247

53-
with exits_with_not_found, warns_absolute_root_override:
48+
with warns_cli_root_override, exits_with_not_found:
5449
get_output(["-c", PYPROJECT_TOML, "--root=.."])
5550

5651
with warns_cli_root_override:

0 commit comments

Comments
 (0)