Skip to content

Commit af06f24

Browse files
committed
go fish
1 parent 8f8c127 commit af06f24

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
@@ -601,11 +601,11 @@ def test_sort_parametrized(input, expected_output):
601601
assert new_test is not None
602602
assert new_test.replace('"', "'") == expected.format(
603603
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_results_temp",
604-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
604+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
605605
).replace('"', "'")
606606
assert new_test_perf.replace('"', "'") == expected_perfonly.format(
607607
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_results_temp",
608-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
608+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
609609
).replace('"', "'")
610610
#
611611
# Overwrite old test with new instrumented test
@@ -833,7 +833,7 @@ def test_sort_parametrized_loop(input, expected_output):
833833
assert new_test is not None
834834
assert new_test.replace('"', "'") == expected.format(
835835
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_loop_results_temp",
836-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
836+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
837837
).replace('"', "'")
838838

839839
# Overwrite old test with new instrumented test
@@ -842,7 +842,7 @@ def test_sort_parametrized_loop(input, expected_output):
842842

843843
assert new_test_perf.replace('"', "'") == expected_perf.format(
844844
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_parametrized_loop_results_temp",
845-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
845+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
846846
).replace('"', "'")
847847

848848
# Overwrite old test with new instrumented test
@@ -1144,12 +1144,12 @@ def test_sort():
11441144
assert new_test_behavior is not None
11451145
assert new_test_behavior.replace('"', "'") == expected.format(
11461146
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_loop_results_temp",
1147-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1147+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
11481148
).replace('"', "'")
11491149

11501150
assert new_test_perf.replace('"', "'") == expected_perf.format(
11511151
module_path="code_to_optimize.tests.pytest.test_perfinjector_bubble_sort_loop_results_temp",
1152-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1152+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
11531153
).replace('"', "'")
11541154

11551155
# Overwrite old test with new instrumented test
@@ -1421,11 +1421,11 @@ def test_sort(self):
14211421
assert new_test_behavior is not None
14221422
assert new_test_behavior.replace('"', "'") == expected.format(
14231423
module_path="code_to_optimize.tests.unittest.test_perfinjector_bubble_sort_unittest_results_temp",
1424-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1424+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
14251425
).replace('"', "'")
14261426
assert new_test_perf.replace('"', "'") == expected_perf.format(
14271427
module_path="code_to_optimize.tests.unittest.test_perfinjector_bubble_sort_unittest_results_temp",
1428-
tmp_dir_path=get_run_tmp_file(Path("test_return_values")),
1428+
tmp_dir_path=get_run_tmp_file("test_return_values").as_posix(),
14291429
).replace('"', "'")
14301430
#
14311431
# Overwrite old test with new instrumented test

0 commit comments

Comments
 (0)