|
15 | 15 |
|
16 | 16 | from pluggy import HookspecMarker |
17 | 17 |
|
| 18 | +from .deprecated import HOOK_LEGACY_PATH_ARG |
| 19 | + |
18 | 20 |
|
19 | 21 | if TYPE_CHECKING: |
20 | 22 | import pdb |
@@ -297,7 +299,14 @@ def pytest_collection_finish(session: "Session") -> None: |
297 | 299 | """ |
298 | 300 |
|
299 | 301 |
|
300 | | -@hookspec(firstresult=True) |
| 302 | +@hookspec( |
| 303 | + firstresult=True, |
| 304 | + warn_on_impl_args={ |
| 305 | + "path": HOOK_LEGACY_PATH_ARG.format( |
| 306 | + pylib_path_arg="path", pathlib_path_arg="collection_path" |
| 307 | + ), |
| 308 | + }, |
| 309 | +) |
301 | 310 | def pytest_ignore_collect( |
302 | 311 | collection_path: Path, path: "LEGACY_PATH", config: "Config" |
303 | 312 | ) -> Optional[bool]: |
@@ -356,6 +365,13 @@ def pytest_collect_directory(path: Path, parent: "Collector") -> "Optional[Colle |
356 | 365 | """ |
357 | 366 |
|
358 | 367 |
|
| 368 | +@hookspec( |
| 369 | + warn_on_impl_args={ |
| 370 | + "path": HOOK_LEGACY_PATH_ARG.format( |
| 371 | + pylib_path_arg="path", pathlib_path_arg="file_path" |
| 372 | + ), |
| 373 | + }, |
| 374 | +) |
359 | 375 | def pytest_collect_file( |
360 | 376 | file_path: Path, path: "LEGACY_PATH", parent: "Collector" |
361 | 377 | ) -> "Optional[Collector]": |
@@ -468,7 +484,14 @@ def pytest_make_collect_report(collector: "Collector") -> "Optional[CollectRepor |
468 | 484 | # ------------------------------------------------------------------------- |
469 | 485 |
|
470 | 486 |
|
471 | | -@hookspec(firstresult=True) |
| 487 | +@hookspec( |
| 488 | + firstresult=True, |
| 489 | + warn_on_impl_args={ |
| 490 | + "path": HOOK_LEGACY_PATH_ARG.format( |
| 491 | + pylib_path_arg="path", pathlib_path_arg="module_path" |
| 492 | + ), |
| 493 | + }, |
| 494 | +) |
472 | 495 | def pytest_pycollect_makemodule( |
473 | 496 | module_path: Path, path: "LEGACY_PATH", parent |
474 | 497 | ) -> Optional["Module"]: |
@@ -994,6 +1017,13 @@ def pytest_assertion_pass(item: "Item", lineno: int, orig: str, expl: str) -> No |
994 | 1017 | # ------------------------------------------------------------------------- |
995 | 1018 |
|
996 | 1019 |
|
| 1020 | +@hookspec( |
| 1021 | + warn_on_impl_args={ |
| 1022 | + "startdir": HOOK_LEGACY_PATH_ARG.format( |
| 1023 | + pylib_path_arg="startdir", pathlib_path_arg="start_path" |
| 1024 | + ), |
| 1025 | + }, |
| 1026 | +) |
997 | 1027 | def pytest_report_header( # type:ignore[empty-body] |
998 | 1028 | config: "Config", start_path: Path, startdir: "LEGACY_PATH" |
999 | 1029 | ) -> Union[str, List[str]]: |
@@ -1022,6 +1052,13 @@ def pytest_report_header( # type:ignore[empty-body] |
1022 | 1052 | """ |
1023 | 1053 |
|
1024 | 1054 |
|
| 1055 | +@hookspec( |
| 1056 | + warn_on_impl_args={ |
| 1057 | + "startdir": HOOK_LEGACY_PATH_ARG.format( |
| 1058 | + pylib_path_arg="startdir", pathlib_path_arg="start_path" |
| 1059 | + ), |
| 1060 | + }, |
| 1061 | +) |
1025 | 1062 | def pytest_report_collectionfinish( # type:ignore[empty-body] |
1026 | 1063 | config: "Config", |
1027 | 1064 | start_path: Path, |
|
0 commit comments