Coverage for tests/test_deprecation.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-04-14 00:18 +0000

1from typing import Optional 1iabcdefgh

2 

3import pytest 1iabcdefgh

4import typer 1iabcdefgh

5from typer.testing import CliRunner 1iabcdefgh

6 

7runner = CliRunner() 1iabcdefgh

8 

9 

10def test_deprecation(): 1iabcdefgh

11 app = typer.Typer() 1iabcdefgh

12 

13 def add_command(): 1iabcdefgh

14 @app.command() 1iabcdefgh

15 def cmd( 1abcdefgh

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

17 3.14, 1iabcdefgh

18 is_flag=True, 1iabcdefgh

19 flag_value="42", 1iabcdefgh

20 help="Some wonderful number", 1iabcdefgh

21 ), 

22 ): ... # pragma: no cover 

23 

24 with pytest.warns( 1iabcdefgh

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

26 ): 

27 add_command() 1iabcdefgh