Coverage for tests/test_prog_name.py: 100%

7 statements  

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

1import subprocess 1abcdefgh

2import sys 1abcdefgh

3from pathlib import Path 1abcdefgh

4 

5 

6def test_custom_prog_name(): 1abcdefgh

7 file_path = Path(__file__).parent / "assets/prog_name.py" 1abcdefgh

8 result = subprocess.run( 1abcdefgh

9 [sys.executable, "-m", "coverage", "run", str(file_path), "--help"], 

10 capture_output=True, 

11 encoding="utf-8", 

12 ) 

13 assert "Usage: custom-name [OPTIONS] I" in result.stdout 1abcdefgh