Coverage for docs_src/parameter_types/path/tutorial002_an.py: 100%

6 statements  

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

1from pathlib import Path 1iabcdefgh

2 

3import typer 1iabcdefgh

4from typing_extensions import Annotated 1iabcdefgh

5 

6 

7def main( 1abcdefgh

8 config: Annotated[ 

9 Path, 

10 typer.Option( 

11 exists=True, 

12 file_okay=True, 

13 dir_okay=False, 

14 writable=False, 

15 readable=True, 

16 resolve_path=True, 

17 ), 

18 ], 

19): 

20 text = config.read_text() 1iabcdefgh

21 print(f"Config file contents: {text}") 1iabcdefgh

22 

23 

24if __name__ == "__main__": 1iabcdefgh

25 typer.run(main) 1iabcdefgh