File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ repos:
4040 hooks :
4141 - id : ruff
4242 args : [--fix, --exit-non-zero-on-fix]
43+ - repo : https://github.com/pre-commit/mirrors-mypy
44+ rev : v1.6.0
45+ hooks :
46+ - id : mypy
47+ # empty args needed in order to match mypy cli behavior
48+ args : [--strict]
49+ additional_dependencies :
50+ - pytest
4351 - repo : https://github.com/adrienverge/yamllint.git
4452 rev : v1.32.0
4553 hooks :
Original file line number Diff line number Diff line change 33import os
44
55import pytest
6+ from _pytest .terminal import TerminalReporter
67
78
89def pytest_sessionfinish (session : pytest .Session ) -> None :
@@ -13,6 +14,8 @@ def pytest_sessionfinish(session: pytest.Session) -> None:
1314 that functionality is ignored.
1415 """
1516 terminalreporter = session .config .pluginmanager .get_plugin ("terminalreporter" )
17+ if not isinstance (terminalreporter , TerminalReporter ):
18+ raise TypeError
1619 req_passed = int (os .environ .get ("PYTEST_REQPASS" , "0" ))
1720 if req_passed and not session .config .option .collectonly :
1821 passed = 0
@@ -27,7 +30,7 @@ def pytest_sessionfinish(session: pytest.Session) -> None:
2730 session .exitstatus = 1
2831
2932
30- @pytest .hookimpl (tryfirst = True )
33+ @pytest .hookimpl (tryfirst = True ) # type: ignore[misc,unused-ignore]
3134def pytest_collection_modifyitems (items : list [pytest .Item ]) -> None :
3235 """Ensure testing fails if tests have duplicate names."""
3336 errors = []
You can’t perform that action at this time.
0 commit comments