Coverage for tests / test_deprecation.py: 100%

10 statements  

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

1from typing import Optional 1abcdefgh

2 

3import pytest 1abcdefgh

4import typer 1abcdefgh

5from typer.testing import CliRunner 1abcdefgh

6 

7runner = CliRunner() 1abcdefgh

8 

9 

10def test_deprecation(): 1abcdefgh

11 app = typer.Typer() 1abcdefgh

12 

13 def add_command(): 1abcdefgh

14 @app.command() 1abcdefgh

15 def cmd( 1abcdefgh

16 opt: Optional[float] = typer.Option( 1abcdefgh

17 3.14, 1abcdefgh

18 is_flag=True, 1abcdefgh

19 flag_value="42", 1abcdefgh

20 help="Some wonderful number", 1abcdefgh

21 ), 

22 ): ... # pragma: no cover 

23 

24 with pytest.warns( 1abcdefgh

25 match="The 'is_flag' and 'flag_value' parameters are not supported by Typer" 

26 ): 

27 add_command() 1abcdefgh