hookspec: add pathlib.Path alternatives to py.path.local parameters in hooks

As part of the ongoing migration for py.path to pathlib, make sure all
hooks which take a py.path.local also take an equivalent pathlib.Path.
This commit is contained in:
Ran Benita
2020-12-14 18:16:14 +02:00
parent 2cb34a99cb
commit 592b32bd69
6 changed files with 76 additions and 25 deletions

View File

@@ -1010,7 +1010,7 @@ class TestTerminalFunctional:
def test_report_collectionfinish_hook(self, pytester: Pytester, params) -> None:
pytester.makeconftest(
"""
def pytest_report_collectionfinish(config, startdir, items):
def pytest_report_collectionfinish(config, startpath, startdir, items):
return ['hello from hook: {0} items'.format(len(items))]
"""
)
@@ -1436,8 +1436,8 @@ class TestGenericReporting:
)
pytester.mkdir("a").joinpath("conftest.py").write_text(
"""
def pytest_report_header(config, startdir):
return ["line1", str(startdir)]
def pytest_report_header(config, startdir, startpath):
return ["line1", str(startpath)]
"""
)
result = pytester.runpytest("a")