Skip to content

Commit 485bc19

Browse files
authored
Merge pull request #255 from codeflash-ai/replay-test-bug
Replay test template bug
2 parents ba6a1c0 + df97c30 commit 485bc19

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

codeflash/benchmarking/replay_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ def create_trace_replay_test_code(
115115
if function_name == "__init__":
116116
ret = {class_name_alias}(*args[1:], **kwargs)
117117
else:
118-
instance = args[0] # self
119-
ret = instance{method_name}(*args[1:], **kwargs)
118+
ret = {class_name_alias}{method_name}(*args, **kwargs)
120119
"""
121120
)
122121

tests/test_trace_benchmarks.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sorter():
111111
if function_name == "__init__":
112112
ret = code_to_optimize_bubble_sort_codeflash_trace_Sorter(*args[1:], **kwargs)
113113
else:
114-
instance = args[0] # self
115-
ret = instance.sorter(*args[1:], **kwargs)
114+
ret = code_to_optimize_bubble_sort_codeflash_trace_Sorter.sorter(*args, **kwargs)
116115
117116
def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter_sort_class():
118117
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):
@@ -138,8 +137,7 @@ def test_code_to_optimize_bubble_sort_codeflash_trace_Sorter___init__():
138137
if function_name == "__init__":
139138
ret = code_to_optimize_bubble_sort_codeflash_trace_Sorter(*args[1:], **kwargs)
140139
else:
141-
instance = args[0] # self
142-
ret = instance(*args[1:], **kwargs)
140+
ret = code_to_optimize_bubble_sort_codeflash_trace_Sorter(*args, **kwargs)
143141
144142
"""
145143
assert test_class_sort_path.read_text("utf-8").strip()==test_class_sort_code.strip()

0 commit comments

Comments
 (0)