Coverage for tests/test_deprecation.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-11-13 11:07 +0000

1from typing import Optional 1habcdefg

2 

3import pytest 1habcdefg

4import typer 1habcdefg

5from typer.testing import CliRunner 1habcdefg

6 

7runner = CliRunner() 1habcdefg

8 

9 

10def test_deprecation(): 1habcdefg

11 app = typer.Typer() 1habcdefg

12 

13 def add_command(): 1habcdefg

14 @app.command() 1habcdefg

15 def cmd( 1abcdefg

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

17 3.14, 1habcdefg

18 is_flag=True, 1habcdefg

19 flag_value="42", 1habcdefg

20 help="Some wonderful number", 1habcdefg

21 ), 

22 ): ... # pragma: no cover 

23 

24 with pytest.warns( 1habcdefg

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

26 ): 

27 add_command() 1habcdefg