Coverage for docs_src/testing/app03/test_main.py: 100%

10 statements  

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

1import typer 1abcdefgh

2from typer.testing import CliRunner 1abcdefgh

3 

4from .main import main 1abcdefgh

5 

6app = typer.Typer() 1abcdefgh

7app.command()(main) 1abcdefgh

8 

9runner = CliRunner() 1abcdefgh

10 

11 

12def test_app(): 1abcdefgh

13 result = runner.invoke(app, ["--name", "Camila"]) 1abcdefgh

14 assert result.exit_code == 0 1abcdefgh

15 assert "Hello Camila" in result.stdout 1abcdefgh