Deprecate pytest_cmdline_preparse

Close #8592 

PR #8956
This commit is contained in:
Simon K
2021-07-31 14:53:43 +01:00
committed by GitHub
parent 0fd0e2a27c
commit c27db3bd8e
5 changed files with 48 additions and 0 deletions

View File

@@ -190,3 +190,20 @@ def test_warns_none_is_deprecated():
):
with pytest.warns(None): # type: ignore[call-overload]
pass
def test_deprecation_of_cmdline_preparse(pytester: Pytester) -> None:
pytester.makeconftest(
"""
def pytest_cmdline_preparse(config, args):
...
"""
)
result = pytester.runpytest()
result.stdout.fnmatch_lines(
[
"*PytestDeprecationWarning: The pytest_cmdline_preparse hook is deprecated*",
"*Please use pytest_load_initial_conftests hook instead.*",
]
)