Skip to content

Commit a0770e0

Browse files
committed
update expectations here
1 parent 3048ece commit a0770e0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_instrument_line_profiler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def hi():
5555
5656
5757
class BubbleSortClass:
58+
@codeflash_line_profile
5859
def __init__(self):
5960
pass
6061
@@ -117,7 +118,9 @@ def sort_classmethod(x):
117118
return y.sorter(x)
118119
"""
119120
assert code_path.read_text("utf-8") == expected_code_main
120-
assert code_context.helper_functions.__len__() == 0
121+
# WrapperClass.__init__ is now detected as a helper since WrapperClass.BubbleSortClass() instantiates it
122+
assert len(code_context.helper_functions) == 1
123+
assert code_context.helper_functions[0].qualified_name == "WrapperClass.__init__"
121124
finally:
122125
func_optimizer.write_code_and_helpers(
123126
func_optimizer.function_to_optimize_source_code, original_helper_code, func_optimizer.function_to_optimize.file_path
@@ -283,6 +286,7 @@ def sorter(arr):
283286
ans = helper(arr)
284287
return ans
285288
class helper:
289+
@codeflash_line_profile
286290
def __init__(self, arr):
287291
return arr.sort()
288292
"""

0 commit comments

Comments
 (0)