Ensure no log messages with error severity or higher were reported during test execution.
(caplog)
| 90 | |
| 91 | @pytest.fixture(autouse=True) |
| 92 | def no_logs_gte_error(caplog): |
| 93 | """Ensure no log messages with error severity or higher were reported during test execution.""" |
| 94 | EXCLUDED_MODULES = set() |
| 95 | yield |
| 96 | errors = [ |
| 97 | record |
| 98 | for record in caplog.get_records("call") |
| 99 | if record.levelno >= logging.ERROR and record.module not in EXCLUDED_MODULES |
| 100 | ] |
| 101 | assert not errors, "Test failed due to presence of one or more logs with ERROR severity." |
| 102 | |
| 103 | |
| 104 | @pytest.fixture |
nothing calls this directly
no outgoing calls
no test coverage detected