Skip to content

Commit

Permalink
Avoid breaking apart testcase name when they contain spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcCote committed Jan 9, 2025
1 parent 5f5a7df commit 29fa19e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions swebench/harness/log_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,11 @@ def parse_log_pytest_v2(log: str) -> dict[str, str]:
if line.startswith(TestStatus.FAILED.value):
line = line.replace(" - ", " ")
test_case = line.split()
if len(test_case) >= 2:
test_status_map[test_case[1]] = test_case[0]
test_status_map[" ".join(test_case[1:])] = test_case[0]
# Support older pytest versions by checking if the line ends with the test status
elif any([line.endswith(x.value) for x in TestStatus]):
test_case = line.split()
if len(test_case) >= 2:
test_status_map[test_case[0]] = test_case[1]
test_status_map[" ".join(test_case[:-1])] = test_case[-1]
return test_status_map


Expand Down

0 comments on commit 29fa19e

Please sign in to comment.