Skip to content

Commit 2022e85

Browse files
committed
Update cli.py
1 parent 2c8d2ba commit 2022e85

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

codeflash/cli_cmds/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import importlib.util
12
import logging
23
import sys
34
from argparse import SUPPRESS, ArgumentParser, Namespace
@@ -145,6 +146,14 @@ def process_and_validate_cmd_args(args: Namespace) -> Namespace:
145146
if env_utils.is_ci():
146147
args.no_pr = True
147148

149+
if getattr(args, "async", False) and importlib.util.find_spec("pytest_asyncio") is None:
150+
logger.warning(
151+
"Warning: The --async flag requires pytest-asyncio to be installed.\n"
152+
"Please install it using:\n"
153+
' pip install "codeflash[asyncio]"'
154+
)
155+
raise SystemExit(1)
156+
148157
return args
149158

150159

0 commit comments

Comments
 (0)