Coverage for fastapi/cli.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-05-05 00:03 +0000

1try: 1abcdef

2 from fastapi_cli.cli import main as cli_main 1abcdef

3 

4except ImportError: # pragma: no cover 

5 cli_main = None # type: ignore 

6 

7 

8def main() -> None: 1abcdef

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

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

11 print(message) 1ghijkl

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

13 cli_main() 1abcdef