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

5 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 18:26 +0000

1from pathlib import Path 1habcdefg

2 

3import typer 1habcdefg

4 

5 

6def main( 1abcdefg

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() 1habcdefg

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

19 

20 

21if __name__ == "__main__": 1habcdefg

22 typer.run(main) 1habcdefg