Coverage for docs_src/testing/app01/main.py: 100%

8 statements  

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

1from typing import Optional 1abcdefghi

2 

3import typer 1abcdefghi

4 

5app = typer.Typer() 1abcdefghi

6 

7 

8@app.command() 1abcdefghi

9def main(name: str, city: Optional[str] = None): 1abcdefghi

10 print(f"Hello {name}") 1abcdefghi

11 if city: 1abcdefghi

12 print(f"Let's have a coffee in {city}") 1abcdefghi

13 

14 

15if __name__ == "__main__": 1abcdefghi

16 app() 1abcdefghi