(writer)
| 97 | |
| 98 | |
| 99 | def test_exception(writer): |
| 100 | with make_logging_logger("tests.test_interception", InterceptHandler()) as logging_logger: |
| 101 | logger.add(writer, format="{message}") |
| 102 | |
| 103 | try: |
| 104 | 1 / 0 # noqa: B018 |
| 105 | except Exception: |
| 106 | logging_logger.exception("Oops...") |
| 107 | |
| 108 | lines = writer.read().strip().splitlines() |
| 109 | assert lines[0] == "Oops..." |
| 110 | assert lines[-1] == "ZeroDivisionError: division by zero" |
| 111 | assert sum(line.startswith("> ") for line in lines) == 1 |
| 112 | |
| 113 | |
| 114 | def test_level_is_no(writer): |
nothing calls this directly
no test coverage detected
searching dependent graphs…