hookspec: deprecate hookimpls requesting py.path parameters

This commit is contained in:
Ran Benita
2024-04-18 22:08:28 +03:00
parent 042625957a
commit 58136c5376
7 changed files with 81 additions and 5 deletions

View File

@@ -121,6 +121,32 @@ def test_hookproxy_warnings_for_pathlib(tmp_path, hooktype, request):
)
def test_hookimpl_warnings_for_pathlib() -> None:
class Plugin:
def pytest_ignore_collect(self, path: object) -> None:
raise NotImplementedError()
def pytest_collect_file(self, path: object) -> None:
raise NotImplementedError()
def pytest_pycollect_makemodule(self, path: object) -> None:
raise NotImplementedError()
def pytest_report_header(self, startdir: object) -> str:
raise NotImplementedError()
def pytest_report_collectionfinish(self, startdir: object) -> str:
raise NotImplementedError()
pm = pytest.PytestPluginManager()
with pytest.warns(
pytest.PytestRemovedIn9Warning,
match=r"py\.path\.local.* argument is deprecated",
) as wc:
pm.register(Plugin())
assert len(wc.list) == 5
def test_node_ctor_fspath_argument_is_deprecated(pytester: Pytester) -> None:
mod = pytester.getmodulecol("")