Skip to content

Commit b1acaf4

Browse files
committed
fix: Revert pytest hook parameter names to match hookspec
- Changed _item back to item in pytest_runtest_teardown - Changed _session back to session in pytest_sessionfinish - Pytest hooks require exact parameter names matching the hookspec - Cannot use underscore prefix for unused parameters in hooks - Fixes PluginValidationError when running pytest with --testiq-output - All tests passing (190/190)
1 parent 726674c commit b1acaf4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/testiq/pytest_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _is_docstring_line(self, filename: str, lineno: int) -> bool:
157157
self.docstring_lines_cache[filename] = docstring_lines
158158
return lineno in docstring_lines
159159

160-
def pytest_runtest_teardown(self, _item: Item) -> None:
160+
def pytest_runtest_teardown(self, item: Item) -> None:
161161
"""Called after each test finishes."""
162162
# Stop tracing
163163
sys.settrace(None)
@@ -252,7 +252,7 @@ def _add_definition_lines(self, coverage: Dict[str, List[int]]) -> None:
252252

253253
coverage[file_path].extend(definition_lines)
254254

255-
def pytest_sessionfinish(self, _session: Any) -> None:
255+
def pytest_sessionfinish(self, session: Any) -> None:
256256
"""Called after all tests complete."""
257257
if self.test_coverage:
258258
output_path = Path(self.output_file)

0 commit comments

Comments
 (0)