Default command line protocol for initialization, session, running tests and reporting.
(config: Config, session: Session)
| 378 | |
| 379 | |
| 380 | def _main(config: Config, session: Session) -> int | ExitCode | None: |
| 381 | """Default command line protocol for initialization, session, |
| 382 | running tests and reporting.""" |
| 383 | config.hook.pytest_collection(session=session) |
| 384 | config.hook.pytest_runtestloop(session=session) |
| 385 | |
| 386 | if session.testsfailed: |
| 387 | return ExitCode.TESTS_FAILED |
| 388 | elif session.testscollected == 0: |
| 389 | return ExitCode.NO_TESTS_COLLECTED |
| 390 | return None |
| 391 | |
| 392 | |
| 393 | def pytest_collection(session: Session) -> None: |
nothing calls this directly
no test coverage detected