|
4 | 4 | from argparse import Namespace |
5 | 5 | from pathlib import Path |
6 | 6 |
|
7 | | -from codeflash.code_utils.instrument_existing_tests import instrument_source_module_with_async_decorators |
8 | 7 | from codeflash.discovery.functions_to_optimize import FunctionToOptimize |
9 | 8 | from codeflash.models.models import FunctionParent, TestFile, TestFiles, TestingMode, TestType |
10 | 9 | from codeflash.optimization.optimizer import Optimizer |
11 | 10 | from codeflash.verification.instrument_codeflash_capture import instrument_codeflash_capture |
12 | | - |
| 11 | +from codeflash.code_utils.instrument_existing_tests import instrument_source_module_with_async_decorators, inject_profiling_into_existing_test |
13 | 12 |
|
14 | 13 | def test_async_bubble_sort_behavior_results() -> None: |
15 | 14 | test_code = """import asyncio |
@@ -117,13 +116,12 @@ async def test_async_sort(): |
117 | 116 | assert expected_stdout == results_list[0].stdout |
118 | 117 |
|
119 | 118 |
|
120 | | - if len(results_list) > 1: |
121 | | - assert results_list[1].id.function_getting_tested == "async_sorter" |
122 | | - assert results_list[1].id.test_function_name == "test_async_sort" |
123 | | - assert results_list[1].did_pass |
| 119 | + assert results_list[1].id.function_getting_tested == "async_sorter" |
| 120 | + assert results_list[1].id.test_function_name == "test_async_sort" |
| 121 | + assert results_list[1].did_pass |
124 | 122 |
|
125 | | - expected_stdout2 = "codeflash stdout: Async sorting list\nresult: [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]\n" |
126 | | - assert expected_stdout2 == results_list[1].stdout |
| 123 | + expected_stdout2 = "codeflash stdout: Async sorting list\nresult: [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]\n" |
| 124 | + assert expected_stdout2 == results_list[1].stdout |
127 | 125 |
|
128 | 126 | finally: |
129 | 127 | # Restore original code |
|
0 commit comments