Skip to content

Commit

Permalink
Fix exception logging test
Browse files Browse the repository at this point in the history
The latest pytest uses fancier exception formatting, which confused
the check for exception messages with the development profile.
Adjust the test accordingly.
  • Loading branch information
rra committed May 6, 2024
1 parent 63a0808 commit 2e7f1ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/logging_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ def test_dev_exception_logging(caplog: LogCaptureFixture) -> None:

assert caplog.record_tuples[0][0] == "myapp"
assert caplog.record_tuples[0][1] == logging.ERROR
assert "Traceback (most recent call last)" in caplog.record_tuples[0][2]
assert '"this is some exception"' in caplog.record_tuples[0][2]
assert "Traceback" in _strip_color(caplog.record_tuples[0][2])
assert "this is some exception" in _strip_color(caplog.record_tuples[0][2])


def test_production_exception_logging(caplog: LogCaptureFixture) -> None:
Expand Down

0 comments on commit 2e7f1ed

Please sign in to comment.