Skip to content

Commit d68409a

Browse files
committed
update to match new def naming
1 parent bf6acc9 commit d68409a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_trace_benchmarks.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_trace_benchmarks() -> None:
3333
function_calls = cursor.fetchall()
3434

3535
# Assert the length of function calls
36-
assert len(function_calls) == 7, f"Expected 7 function calls, but got {len(function_calls)}"
36+
assert len(function_calls) == 8, f"Expected 8 function calls, but got {len(function_calls)}"
3737

3838
bubble_sort_path = (project_root / "bubble_sort_codeflash_trace.py").as_posix()
3939
process_and_bubble_sort_path = (project_root / "process_and_bubble_sort_codeflash_trace.py").as_posix()
@@ -82,7 +82,7 @@ def test_trace_benchmarks() -> None:
8282
# Close connection
8383
conn.close()
8484
generate_replay_test(output_file, replay_tests_dir)
85-
test_class_sort_path = replay_tests_dir/ Path("test_tests_pytest_benchmarks_test_test_benchmark_bubble_sort_example__replay_test_0.py")
85+
test_class_sort_path = replay_tests_dir/ Path("test_code_to_optimize_tests_pytest_benchmarks_test_test_benchmark_bubble_sort_example__replay_test_0.py")
8686
assert test_class_sort_path.exists()
8787
test_class_sort_code = f"""
8888
from code_to_optimize.bubble_sort_codeflash_trace import \\
@@ -95,13 +95,13 @@ def test_trace_benchmarks() -> None:
9595
functions = ['sort_class', 'sort_static', 'sorter']
9696
trace_file_path = r"{output_file.as_posix()}"
9797
98-
def test_code_to_optimize_bubble_sort_codeflash_trace_sorter():
98+
def test_code_to_optimize_bubble_sort_codeflash_trace_sorter_test_sort():
9999
for args_pkl, kwargs_pkl in get_next_arg_and_return(trace_file=trace_file_path, benchmark_function_name="test_sort", function_name="sorter", file_path=r"{bubble_sort_path}", num_to_get=100):
100100
args = pickle.loads(args_pkl)
101101
kwargs = pickle.loads(kwargs_pkl)
102102
ret = code_to_optimize_bubble_sort_codeflash_trace_sorter(*args, **kwargs)
103103
104-
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sorter():
104+
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sorter_test_class_sort():
105105
for args_pkl, kwargs_pkl in get_next_arg_and_return(trace_file=trace_file_path, benchmark_function_name="test_class_sort", function_name="sorter", file_path=r"{bubble_sort_path}", class_name="Sorter", num_to_get=100):
106106
args = pickle.loads(args_pkl)
107107
kwargs = pickle.loads(kwargs_pkl)
@@ -113,21 +113,21 @@ def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sorter():
113113
else:
114114
ret = code_to_optimize_bubble_sort_codeflash_trace_Sorter.sorter(*args, **kwargs)
115115
116-
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sort_class():
116+
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sort_class_test_class_sort2():
117117
for args_pkl, kwargs_pkl in get_next_arg_and_return(trace_file=trace_file_path, benchmark_function_name="test_class_sort2", function_name="sort_class", file_path=r"{bubble_sort_path}", class_name="Sorter", num_to_get=100):
118118
args = pickle.loads(args_pkl)
119119
kwargs = pickle.loads(kwargs_pkl)
120120
if not args:
121121
raise ValueError("No arguments provided for the method.")
122122
ret = code_to_optimize_bubble_sort_codeflash_trace_Sorter.sort_class(*args[1:], **kwargs)
123123
124-
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sort_static():
124+
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sort_static_test_class_sort3():
125125
for args_pkl, kwargs_pkl in get_next_arg_and_return(trace_file=trace_file_path, benchmark_function_name="test_class_sort3", function_name="sort_static", file_path=r"{bubble_sort_path}", class_name="Sorter", num_to_get=100):
126126
args = pickle.loads(args_pkl)
127127
kwargs = pickle.loads(kwargs_pkl)
128128
ret = code_to_optimize_bubble_sort_codeflash_trace_Sorter.sort_static(*args, **kwargs)
129129
130-
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter___init__():
130+
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter___init___test_class_sort4():
131131
for args_pkl, kwargs_pkl in get_next_arg_and_return(trace_file=trace_file_path, benchmark_function_name="test_class_sort4", function_name="__init__", file_path=r"{bubble_sort_path}", class_name="Sorter", num_to_get=100):
132132
args = pickle.loads(args_pkl)
133133
kwargs = pickle.loads(kwargs_pkl)
@@ -142,7 +142,7 @@ def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter___init__():
142142
"""
143143
assert test_class_sort_path.read_text("utf-8").strip()==test_class_sort_code.strip()
144144

145-
test_sort_path = replay_tests_dir / Path("test_tests_pytest_benchmarks_test_test_process_and_sort_example__replay_test_0.py")
145+
test_sort_path = replay_tests_dir / Path("test_code_to_optimize_tests_pytest_benchmarks_test_test_process_and_sort_example__replay_test_0.py")
146146
assert test_sort_path.exists()
147147
test_sort_code = f"""
148148
from code_to_optimize.bubble_sort_codeflash_trace import \\

0 commit comments

Comments
 (0)