Coverage for tests/test_deprecation.py: 100%
10 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-19 20:29 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-19 20:29 +0000
1from typing import Optional 1abcdefghi
3import pytest 1abcdefghi
4import typer 1abcdefghi
5from typer.testing import CliRunner 1abcdefghi
7runner = CliRunner() 1abcdefghi
10def test_deprecation(): 1abcdefghi
11 app = typer.Typer() 1abcdefghi
13 def add_command(): 1abcdefghi
14 @app.command() 1abcdefghi
15 def cmd( 1abcdefghi
16 opt: Optional[float] = typer.Option( 1abcdefghi
17 3.14, 1abcdefghi
18 is_flag=True, 1abcdefghi
19 flag_value="42", 1abcdefghi
20 help="Some wonderful number", 1abcdefghi
21 ),
22 ): ... # pragma: no cover
24 with pytest.warns( 1abcdefghi
25 match="The 'is_flag' and 'flag_value' parameters are not supported by Typer"
26 ):
27 add_command() 1abcdefghi