Rename pytest_report_header startpath parameter to start_path
This commit is contained in:
parent
5288588971
commit
f72efb6ed8
|
@ -13,7 +13,7 @@ imply_paths_hooks = {
|
|||
"pytest_ignore_collect": ("collection_path", "path"),
|
||||
"pytest_collect_file": ("file_path", "path"),
|
||||
"pytest_pycollect_makemodule": ("module_path", "path"),
|
||||
"pytest_report_header": ("startpath", "startdir"),
|
||||
"pytest_report_header": ("start_path", "startdir"),
|
||||
"pytest_report_collectionfinish": ("startpath", "startdir"),
|
||||
}
|
||||
|
||||
|
|
|
@ -674,12 +674,12 @@ def pytest_assertion_pass(item: "Item", lineno: int, orig: str, expl: str) -> No
|
|||
|
||||
|
||||
def pytest_report_header(
|
||||
config: "Config", startpath: Path, startdir: "LEGACY_PATH"
|
||||
config: "Config", start_path: Path, startdir: "LEGACY_PATH"
|
||||
) -> Union[str, List[str]]:
|
||||
"""Return a string or list of strings to be displayed as header info for terminal reporting.
|
||||
|
||||
:param pytest.Config config: The pytest config object.
|
||||
:param Path startpath: The starting dir.
|
||||
:param Path start_path: The starting dir.
|
||||
:param LEGACY_PATH startdir: The starting dir (deprecated).
|
||||
|
||||
.. note::
|
||||
|
@ -696,7 +696,7 @@ def pytest_report_header(
|
|||
:ref:`discovers plugins during startup <pluginorder>`.
|
||||
|
||||
.. versionchanged:: 7.0.0
|
||||
The ``startpath`` parameter was added as a :class:`pathlib.Path`
|
||||
The ``start_path`` parameter was added as a :class:`pathlib.Path`
|
||||
equivalent of the ``startdir`` parameter. The ``startdir`` parameter
|
||||
has been deprecated.
|
||||
"""
|
||||
|
|
|
@ -702,7 +702,7 @@ class TerminalReporter:
|
|||
msg += " -- " + str(sys.executable)
|
||||
self.write_line(msg)
|
||||
lines = self.config.hook.pytest_report_header(
|
||||
config=self.config, startpath=self.startpath
|
||||
config=self.config, start_path=self.startpath
|
||||
)
|
||||
self._write_report_lines_from_hooks(lines)
|
||||
|
||||
|
|
|
@ -1461,8 +1461,8 @@ class TestGenericReporting:
|
|||
)
|
||||
pytester.mkdir("a").joinpath("conftest.py").write_text(
|
||||
"""
|
||||
def pytest_report_header(config, startpath):
|
||||
return ["line1", str(startpath)]
|
||||
def pytest_report_header(config, start_path):
|
||||
return ["line1", str(start_path)]
|
||||
"""
|
||||
)
|
||||
result = pytester.runpytest("a")
|
||||
|
|
Loading…
Reference in New Issue