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

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 18:26 +0000

1from typing import Optional 1abcdefgh

2 

3import typer 1abcdefgh

4 

5app = typer.Typer() 1abcdefgh

6 

7 

8@app.command() 1abcdefgh

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

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

11 if city: 1abcdefgh

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

13 

14 

15if __name__ == "__main__": 1abcdefgh

16 app() 1abcdefgh