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

5 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

4 

5 

6def main( 1abcdefgh

7 config: Path = typer.Option( 

8 ..., 

9 exists=True, 

10 file_okay=True, 

11 dir_okay=False, 

12 writable=False, 

13 readable=True, 

14 resolve_path=True, 

15 ), 

16): 

17 text = config.read_text() 1iabcdefgh

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

19 

20 

21if __name__ == "__main__": 1iabcdefgh

22 typer.run(main) 1iabcdefgh