Fix unawaited coroutine warning in test_skips_ai_test_generation

optimize() is now async, so the test must use async def + await.
This commit is contained in:
Kevin Turcios 2026-04-23 01:47:26 -05:00
parent 92e39d6923
commit 815eba00c0

View file

@ -144,7 +144,7 @@ class TestNoGenTests:
opt = PythonFunctionOptimizer(ctx=ctx, no_gen_tests=True)
assert opt.no_gen_tests is True
def test_skips_ai_test_generation(self) -> None:
async def test_skips_ai_test_generation(self) -> None:
"""When no_gen_tests=True, generate_ai_tests is never called."""
_mod = "codeflash_python.pipeline._function_optimizer"
_cls = f"{_mod}.PythonFunctionOptimizer"
@ -180,6 +180,6 @@ class TestNoGenTests:
# optimize() will exit early at the baseline step since
# test_files is None, but the generate_ai_tests guard
# is checked before that.
opt.optimize(fn_input)
await opt.optimize(fn_input)
mock_gen.assert_not_called()