diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 4469f5078..a893517aa 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -396,7 +396,9 @@ def pytest_runtest_protocol( Stops at first non-None result, see :ref:`firstresult` """ -def pytest_runtest_logstart(nodeid, location): +def pytest_runtest_logstart( + nodeid: str, location: Tuple[str, Optional[int], str] +) -> None: """ signal the start of running a single test item. This hook will be called **before** :func:`pytest_runtest_setup`, :func:`pytest_runtest_call` and @@ -407,7 +409,9 @@ def pytest_runtest_logstart(nodeid, location): """ -def pytest_runtest_logfinish(nodeid, location): +def pytest_runtest_logfinish( + nodeid: str, location: Tuple[str, Optional[int], str] +) -> None: """ signal the complete finish of running a single test item. This hook will be called **after** :func:`pytest_runtest_setup`, :func:`pytest_runtest_call` and diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 04bf74b6c..8755e5611 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -653,12 +653,12 @@ class LoggingPlugin: yield # run all the tests @pytest.hookimpl - def pytest_runtest_logstart(self): + def pytest_runtest_logstart(self) -> None: self.log_cli_handler.reset() self.log_cli_handler.set_when("start") @pytest.hookimpl - def pytest_runtest_logreport(self): + def pytest_runtest_logreport(self) -> None: self.log_cli_handler.set_when("logreport") def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None, None, None]: diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index f98c9b8ab..6a58260e9 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -502,7 +502,9 @@ class TerminalReporter: def pytest_deselected(self, items) -> None: self._add_stats("deselected", items) - def pytest_runtest_logstart(self, nodeid, location) -> None: + def pytest_runtest_logstart( + self, nodeid: str, location: Tuple[str, Optional[int], str] + ) -> None: # ensure that the path is printed before the # 1st test of a module starts running if self.showlongtestinfo: @@ -569,7 +571,7 @@ class TerminalReporter: assert self._session is not None return len(self._progress_nodeids_reported) == self._session.testscollected - def pytest_runtest_logfinish(self, nodeid) -> None: + def pytest_runtest_logfinish(self, nodeid: str) -> None: assert self._session if self.verbosity <= 0 and self._show_progress_info: if self._show_progress_info == "count":