Skip to content

Commit 3e0440b

Browse files
safter
1 parent 5830a70 commit 3e0440b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

codeflash/verification/equivalence.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,17 @@ def compare_test_results(original_results: TestResults, candidate_results: TestR
4040
for test_id in test_ids_superset:
4141
original_test_result = original_results.get_by_unique_invocation_loop_id(test_id)
4242
cdd_test_result = candidate_results.get_by_unique_invocation_loop_id(test_id)
43-
candidate_pytest_error = candidate_results.test_failures.get(original_test_result.id.test_function_name)
43+
candidate_test_failures = candidate_results.test_failures
44+
# original_test_failures = original_results.test_failures
45+
cdd_pytest_error = (
46+
candidate_test_failures.get(original_test_result.id.test_function_name, "")
47+
if candidate_test_failures
48+
else ""
49+
)
50+
# original_pytest_error = (
51+
# original_test_failures.get(original_test_result.id.test_function_name, "") if original_test_failures else ""
52+
# )
53+
4454
if cdd_test_result is not None and original_test_result is None:
4555
continue
4656
# If helper function instance_state verification is not present, that's ok. continue
@@ -69,7 +79,7 @@ def compare_test_results(original_results: TestResults, candidate_results: TestR
6979
test_src_code=test_src_code,
7080
original_value=original_test_result.return_value,
7181
candidate_value=cdd_test_result.return_value,
72-
pytest_error=candidate_pytest_error,
82+
pytest_error=cdd_pytest_error,
7383
)
7484
)
7585

@@ -94,7 +104,7 @@ def compare_test_results(original_results: TestResults, candidate_results: TestR
94104
test_src_code=test_src_code,
95105
original_value=original_test_result.stdout,
96106
candidate_value=cdd_test_result.stdout,
97-
pytest_error=candidate_pytest_error,
107+
pytest_error=cdd_pytest_error,
98108
)
99109
)
100110
break
@@ -111,7 +121,7 @@ def compare_test_results(original_results: TestResults, candidate_results: TestR
111121
test_src_code=test_src_code,
112122
original_value=original_test_result.did_pass,
113123
candidate_value=cdd_test_result.did_pass,
114-
pytest_error=candidate_pytest_error,
124+
pytest_error=cdd_pytest_error,
115125
)
116126
)
117127
break

0 commit comments

Comments
 (0)