Skip to content

Commit c2817f9

Browse files
author
Codeflash Bot
committed
tests work now
1 parent ecbceec commit c2817f9

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/test_instrument_all_and_run.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_sort():
6262

6363
expected = (
6464
"""import gc
65+
import inspect
6566
import os
6667
import sqlite3
6768
import time
@@ -81,10 +82,14 @@ def test_sort():
8182
codeflash_cur = codeflash_con.cursor()
8283
codeflash_cur.execute('CREATE TABLE IF NOT EXISTS test_results (test_module_path TEXT, test_class_name TEXT, test_function_name TEXT, function_getting_tested TEXT, loop_index INTEGER, iteration_id TEXT, runtime INTEGER, return_value BLOB, verification_type TEXT)')
8384
input = [5, 4, 3, 2, 1, 0]
84-
output = codeflash_wrap(sorter, '{module_path}', None, 'test_sort', 'sorter', '1', codeflash_loop_index, codeflash_cur, codeflash_con, input)
85+
_call__bound__arguments = inspect.signature(sorter).bind(input)
86+
_call__bound__arguments.apply_defaults()
87+
output = codeflash_wrap(sorter, '{module_path}', None, 'test_sort', 'sorter', '1', codeflash_loop_index, codeflash_cur, codeflash_con, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
8588
assert output == [0, 1, 2, 3, 4, 5]
8689
input = [5.0, 4.0, 3.0, 2.0, 1.0, 0.0]
87-
output = codeflash_wrap(sorter, '{module_path}', None, 'test_sort', 'sorter', '4', codeflash_loop_index, codeflash_cur, codeflash_con, input)
90+
_call__bound__arguments = inspect.signature(sorter).bind(input)
91+
_call__bound__arguments.apply_defaults()
92+
output = codeflash_wrap(sorter, '{module_path}', None, 'test_sort', 'sorter', '4', codeflash_loop_index, codeflash_cur, codeflash_con, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
8893
assert output == [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
8994
codeflash_con.close()
9095
"""
@@ -242,6 +247,7 @@ def test_sort():
242247

243248
expected = (
244249
"""import gc
250+
import inspect
245251
import os
246252
import sqlite3
247253
import time
@@ -262,11 +268,15 @@ def test_sort():
262268
codeflash_cur.execute('CREATE TABLE IF NOT EXISTS test_results (test_module_path TEXT, test_class_name TEXT, test_function_name TEXT, function_getting_tested TEXT, loop_index INTEGER, iteration_id TEXT, runtime INTEGER, return_value BLOB, verification_type TEXT)')
263269
input = [5, 4, 3, 2, 1, 0]
264270
sort_class = BubbleSorter()
265-
output = codeflash_wrap(sort_class.sorter, '{module_path}', None, 'test_sort', 'BubbleSorter.sorter', '2', codeflash_loop_index, codeflash_cur, codeflash_con, input)
271+
_call__bound__arguments = inspect.signature(sort_class.sorter).bind(input)
272+
_call__bound__arguments.apply_defaults()
273+
output = codeflash_wrap(sort_class.sorter, '{module_path}', None, 'test_sort', 'BubbleSorter.sorter', '2', codeflash_loop_index, codeflash_cur, codeflash_con, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
266274
assert output == [0, 1, 2, 3, 4, 5]
267275
input = [5.0, 4.0, 3.0, 2.0, 1.0, 0.0]
268276
sort_class = BubbleSorter()
269-
output = codeflash_wrap(sort_class.sorter, '{module_path}', None, 'test_sort', 'BubbleSorter.sorter', '6', codeflash_loop_index, codeflash_cur, codeflash_con, input)
277+
_call__bound__arguments = inspect.signature(sort_class.sorter).bind(input)
278+
_call__bound__arguments.apply_defaults()
279+
output = codeflash_wrap(sort_class.sorter, '{module_path}', None, 'test_sort', 'BubbleSorter.sorter', '6', codeflash_loop_index, codeflash_cur, codeflash_con, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
270280
assert output == [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
271281
codeflash_con.close()
272282
"""

0 commit comments

Comments
 (0)