Skip to content

Commit 416370f

Browse files
committed
explicit consideration of test patches
1 parent 219bc06 commit 416370f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

commit0/harness/get_pytest_ids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def main(repo: str, verbose: int) -> List[List[str]]:
2222
in_file_pass = ""
2323
out = [in_file_fail, in_file_pass]
2424
if verbose:
25-
print(f"{out[0]}\n{out[1]}")
25+
print(f"FAIL TO PASS:\n{out[0]}\nPASS TO PASS:\n{out[1]}")
2626
out = [out[0].split("\n"), out[1].split("\n")]
2727
return out
2828

commit0/harness/run_pytest_ids.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,18 @@ def main(
112112
break # Stop checking other remotes if branch is found
113113
if not found_remote_branch:
114114
raise Exception(f"Branch {branch} does not exist locally or remotely.")
115-
patch = generate_patch_between_commits(
116-
local_repo, example["base_commit"], commit_id
117-
)
115+
if "swe" in dataset_name.lower():
116+
if branch == "reference":
117+
patch = example["test"]["patch"] + "\n\n" + example["test"]["test_patch"]
118+
else:
119+
patch = generate_patch_between_commits(
120+
local_repo, example["base_commit"], commit_id
121+
)
122+
patch += "\n\n" + example["test"]["test_patch"]
123+
else:
124+
patch = generate_patch_between_commits(
125+
local_repo, example["base_commit"], commit_id
126+
)
118127
patch_file = Path(log_dir / "patch.diff")
119128
patch_file.write_text(patch, encoding="utf-8", errors="ignore")
120129

0 commit comments

Comments
 (0)