Coverage for fastapi/cli.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1try: 1abcde

2 from fastapi_cli.cli import main as cli_main 1abcde

3 

4except ImportError: # pragma: no cover 

5 cli_main = None # type: ignore 

6 

7 

8def main() -> None: 1abcde

9 if not cli_main: # type: ignore[truthy-function] 1abcde

10 message = 'To use the fastapi command, please install "fastapi[standard]":\n\n\tpip install "fastapi[standard]"\n' 1abcde

11 print(message) 1abcde

12 raise RuntimeError(message) # noqa: B904 1abcde

13 cli_main() 1abcde