diff --git a/pykern/pkcli/test.py b/pykern/pkcli/test.py index a69f526f..dc196a91 100644 --- a/pykern/pkcli/test.py +++ b/pykern/pkcli/test.py @@ -19,6 +19,7 @@ SUITE_D = "tests" _COROUTINE_NEVER_AWAITED = re.compile("RuntimeWarning: coroutine .+ was never awaited") _FAILED_ON_WARNINGS = "\nFAILED due to:\n" +_PASSED_LOG_PATTERNS = (r"=+ (\d+) passed.*=+", r"PASSED") _TEST_SKIPPED = re.compile(r"^.+\s+SKIPPED\s+\(.+\)$", flags=re.MULTILINE) _TEST_PY = re.compile(r"_test\.py$") @@ -179,10 +180,7 @@ def _fail(output): return f"FAIL {output}" def _remove_passing_messages(content): - for pattern in ( - r"=+ (\d+) passed.*=+", - r"PASSED", - ): + for pattern in _PASSED_LOG_PATTERNS: content = re.sub(pattern, "", content) return content diff --git a/tests/pkcli/test2_test.py b/tests/pkcli/test2_test.py index 273a34e8..edd5c371 100644 --- a/tests/pkcli/test2_test.py +++ b/tests/pkcli/test2_test.py @@ -21,6 +21,4 @@ def test_cases(capsys): o, e = capsys.readouterr() pkio.write_text("stdout.txt", o) pkio.write_text("stderr.txt", e) - pkunit.pkre( - "FAILED due to:\n.*RuntimeWarning: coroutine .+ was never awaited", o - ) + pkunit.pkre("FAILED due to:\nRuntimeWarning: coroutine .+ was never awaited", o)