From 2e7f1edcd21c2dd79ec7f4aaefb72ce75954b6a7 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 6 May 2024 08:51:40 -0700 Subject: [PATCH] Fix exception logging test The latest pytest uses fancier exception formatting, which confused the check for exception messages with the development profile. Adjust the test accordingly. --- tests/logging_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/logging_test.py b/tests/logging_test.py index 35790076..abf9e677 100644 --- a/tests/logging_test.py +++ b/tests/logging_test.py @@ -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: