diff --git a/tests/test_utils_logign.py b/tests/test_utils_logign.py index 296a8ad33..c8b211a32 100644 --- a/tests/test_utils_logign.py +++ b/tests/test_utils_logign.py @@ -34,7 +34,6 @@ def test_ignore_log_msg_behavior(levelname, msg_to_ignore, msg_to_keep, capsys): log.enlarge(msg_to_keep) captured = capsys.readouterr().err - print("Captured stderr:", repr(captured)) assert msg_to_ignore not in captured assert msg_to_keep in captured @@ -57,7 +56,6 @@ def test_ignore_only_by_level(capsys): log.info("Should be visible") captured = capsys.readouterr().err - print("Captured stderr (lvl only):", repr(captured)) assert "Should be hidden" not in captured assert "Should be visible" in captured @@ -80,7 +78,6 @@ def test_ignore_only_by_msg(capsys): log.warning("keep this") captured = capsys.readouterr().err - print("Captured stderr (msg only):", repr(captured)) assert "skip this" not in captured assert "keep this" in captured @@ -103,6 +100,7 @@ def test_filter_removed_after_context(capsys): log.warning("temp msg") # should now appear captured = capsys.readouterr().err - print("Captured stderr (after context):", repr(captured)) assert "temp msg" in captured + count = captured.count("temp msg") + assert count == 1, f"'temp msg' should appear exactly once, found {count}"