Coverage for docs_src / multiple_values / options_with_multiple_values / tutorial001_py39.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-02-09 12:36 +0000

1import typer 1abcdefgh

2 

3app = typer.Typer() 1abcdefgh

4 

5 

6@app.command() 1abcdefgh

7def main(user: tuple[str, int, bool] = typer.Option((None, None, None))): 1abcdefgh

8 username, coins, is_wizard = user 1abcdefgh

9 if not username: 1abcdefgh

10 print("No user provided") 1abcdefgh

11 raise typer.Abort() 1abcdefgh

12 print(f"The username {username} has {coins} coins") 1abcdefgh

13 if is_wizard: 1abcdefgh

14 print("And this user is a wizard!") 1abcdefgh

15 

16 

17if __name__ == "__main__": 1abcdefgh

18 app() 1abcdefgh