You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_parse_pytest_output matches "passed" inside test names ("passed_validation") #157
Regex greediness on test names. If pytest verbose output includes a test like test_42_passed_with_warning ... somewhere in stdout, the first match for r'(\d+)\s+passed' could be the 42 in that test name, not the actual summary line 5 passed, 2 failed.
No anchor to summary line. Pytest's summary lines look like === 5 passed, 2 failed, 1 skipped in 3.21s ===. The right regex should anchor on the summary:
(Bonus) No handling for xfailed, xpassed, errors. Real pytest output regularly contains these and they're currently treated as nothing.
Concrete demonstration: take any project with test_42_passed_smoke.py in its layout, run pytest -v against it with no actual tests passing; the parser will report passed=42 instead of 0.
Fix
Use the anchored summary regex above and prefer the last match in stdout/stderr (pytest always summarises at the very end). Replace the three independent regexes with the single anchored one.
Activity