Skip to content

Commit 7d74e81

Browse files
committed
go fish
1 parent 9db9eec commit 7d74e81

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

codeflash/verification/instrument_codeflash_capture.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def instrument_codeflash_capture(
3030
modified_code = add_codeflash_capture_to_init(
3131
target_classes={class_parent.name},
3232
fto_name=function_to_optimize.function_name,
33-
tmp_dir_path=str(get_run_tmp_file(Path("test_return_values"))),
33+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
3434
code=original_code,
35-
tests_root=tests_root,
35+
tests_root=tests_root.as_posix(),
3636
is_fto=True,
3737
)
3838
function_to_optimize.file_path.write_text(modified_code, encoding="utf-8")
@@ -43,9 +43,9 @@ def instrument_codeflash_capture(
4343
modified_code = add_codeflash_capture_to_init(
4444
target_classes=helper_classes,
4545
fto_name=function_to_optimize.function_name,
46-
tmp_dir_path=str(get_run_tmp_file(Path("test_return_values"))),
46+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
4747
code=original_code,
48-
tests_root=tests_root,
48+
tests_root=tests_root.as_posix(),
4949
is_fto=False,
5050
)
5151
file_path.write_text(modified_code, encoding="utf-8")

tests/test_instrument_tests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,11 @@ def test_sort_parametrized(input, expected_output):
594594
assert new_test is not None
595595
assert new_test.replace('"', "'") == expected.format(
596596
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_results_temp",
597-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
597+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
598598
).replace('"', "'")
599599
assert new_test_perf.replace('"', "'") == expected_perfonly.format(
600600
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_results_temp",
601-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
601+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
602602
).replace('"', "'")
603603
#
604604
# Overwrite old test with new instrumented test
@@ -826,7 +826,7 @@ def test_sort_parametrized_loop(input, expected_output):
826826
assert new_test is not None
827827
assert new_test.replace('"', "'") == expected.format(
828828
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_loop_results_temp",
829-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
829+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
830830
).replace('"', "'")
831831

832832
# Overwrite old test with new instrumented test
@@ -835,7 +835,7 @@ def test_sort_parametrized_loop(input, expected_output):
835835

836836
assert new_test_perf.replace('"', "'") == expected_perf.format(
837837
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_loop_results_temp",
838-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
838+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
839839
).replace('"', "'")
840840

841841
# Overwrite old test with new instrumented test
@@ -1137,12 +1137,12 @@ def test_sort():
11371137
assert new_test_behavior is not None
11381138
assert new_test_behavior.replace('"', "'") == expected.format(
11391139
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_loop_results_temp",
1140-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1140+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
11411141
).replace('"', "'")
11421142

11431143
assert new_test_perf.replace('"', "'") == expected_perf.format(
11441144
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_loop_results_temp",
1145-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1145+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
11461146
).replace('"', "'")
11471147

11481148
# Overwrite old test with new instrumented test
@@ -1414,11 +1414,11 @@ def test_sort(self):
14141414
assert new_test_behavior is not None
14151415
assert new_test_behavior.replace('"', "'") == expected.format(
14161416
module_path="code_to_optimize.tests.unittest.test_perfinjector_bubble_sort_unittest_results_temp",
1417-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1417+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
14181418
).replace('"', "'")
14191419
assert new_test_perf.replace('"', "'") == expected_perf.format(
14201420
module_path="code_to_optimize.tests.unittest.test_perfinjector_bubble_sort_unittest_results_temp",
1421-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1421+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
14221422
).replace('"', "'")
14231423
#
14241424
# Overwrite old test with new instrumented test

0 commit comments

Comments
 (0)