Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions RepoTransAgent/test_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ def analyze_output(self, stdout: str, stderr: str, return_code: int) -> Analysis
tests = []
modules = {}

# Parse pytest output
test_pattern = r'(\S+)::\S+\s+(PASSED|FAILED|ERROR|SKIPPED)'
matches = re.findall(test_pattern, stdout)
# Parse pytest output.
# Anchor to the start of a line and keep the separator on one line: \s would
# match the newline, letting a test id at the end of a short-summary line pair
# with the status token that begins the next one.
test_pattern = r'^(\S+)::\S+[ \t]+(PASSED|FAILED|ERROR|SKIPPED)'
matches = re.findall(test_pattern, stdout, re.MULTILINE)

for match in matches:
test_file, status = match
Expand Down