Skip to content

Commit 40dd92f

Browse files
patchback[bot]The-Compilerpre-commit-ci[bot]
authored
[PR #13980/9f992b8b backport][9.0.x] config: Add a test for -o with invalid option (#13994)
* config: Add a test for -o with invalid option (#13980) This was ignored until #13830. With that change, it now gets correctly surfaced to the user as a warning (or error with --strict-config), so we should have a test for it. (cherry picked from commit 9f992b8) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Florian Bruhin <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b229efb commit 40dd92f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

testing/test_config.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,16 @@ def test_override_ini_without_config_file(self, pytester: Pytester) -> None:
23562356
}
23572357
)
23582358
result = pytester.runpytest("--override-ini", "pythonpath=src")
2359-
assert result.parseoutcomes() == {"passed": 1}
2359+
result.assert_outcomes(passed=1)
2360+
2361+
def test_override_ini_invalid_option(self, pytester: Pytester) -> None:
2362+
result = pytester.runpytest("--override-ini", "doesnotexist=true")
2363+
result.stdout.fnmatch_lines(
2364+
[
2365+
"=*= warnings summary =*=",
2366+
"*PytestConfigWarning:*Unknown config option: doesnotexist",
2367+
]
2368+
)
23602369

23612370

23622371
def test_help_via_addopts(pytester: Pytester) -> None:

0 commit comments

Comments
 (0)