fix: parse pytest output with warnings in check_test_speed
CI / quality (pull_request) Successful in 1m2s
CI / molecule-tests (0) (pull_request) Failing after 3m18s
CI / molecule-tests (2) (pull_request) Failing after 3m33s
CI / molecule-tests (1) (pull_request) Failing after 3m39s

The regex only matched "N passed in X.XXs" but pytest can output
"N passed, M warnings in X.XXs". Updated regex to handle both.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Emil Simeonov
2026-06-20 21:06:41 +02:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 55c2746569
commit d4ea2eef61
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ from gitea_runner_manager.i18n import _
DEFAULT_MAX_SECONDS = 2.0
TEST_COMMAND = ["make", "test-unit"]
_TIMING_RE = re.compile(r"(\d+) passed in ([0-9.]+)s")
_TIMING_RE = re.compile(r"(\d+) passed.* in ([0-9.]+)s")
def run_tests() -> tuple[str, str]:
+3
View File
@@ -35,6 +35,9 @@ class TestParseDuration:
def test_parses_valid_line(self) -> None:
assert parse_duration("234 passed in 0.70s") == 0.70
def test_parses_with_warnings(self) -> None:
assert parse_duration("293 passed, 1 warning in 0.45s") == 0.45
def test_parses_multiline_output(self) -> None:
output = "some header\n234 passed in 1.23s\nfooter"
assert parse_duration(output) == 1.23