If logging is configured to silently ignore errors, pytest doesn't propagate errors either.
(pytester: Pytester)
| 1142 | |
| 1143 | |
| 1144 | def test_logging_emit_error_supressed(pytester: Pytester) -> None: |
| 1145 | """If logging is configured to silently ignore errors, pytest |
| 1146 | doesn't propagate errors either.""" |
| 1147 | pytester.makepyfile( |
| 1148 | """ |
| 1149 | import logging |
| 1150 | |
| 1151 | def test_bad_log(monkeypatch): |
| 1152 | monkeypatch.setattr(logging, 'raiseExceptions', False) |
| 1153 | logging.warning('oops', 'first', 2) |
| 1154 | """ |
| 1155 | ) |
| 1156 | result = pytester.runpytest() |
| 1157 | result.assert_outcomes(passed=1) |
| 1158 | |
| 1159 | |
| 1160 | def test_log_file_cli_subdirectories_are_successfully_created( |
nothing calls this directly
no test coverage detected