Coverage for tests / test_completion / test_completion_path.py: 100%
11 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-02-09 12:36 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-02-09 12:36 +0000
1import os 1abcdefgh
2import subprocess 1abcdefgh
3import sys 1abcdefgh
5from . import path_example as mod 1abcdefgh
8def test_script(): 1abcdefgh
9 result = subprocess.run( 1abcdefgh
10 [sys.executable, "-m", "coverage", "run", mod.__file__, "path/to/deadpool"],
11 capture_output=True,
12 encoding="utf-8",
13 )
14 assert result.returncode == 0 1abcdefgh
15 assert "deadpool" in result.stdout 1abcdefgh
18def test_completion_path_bash(): 1abcdefgh
19 result = subprocess.run( 1abcdefgh
20 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],
21 capture_output=True,
22 encoding="utf-8",
23 env={
24 **os.environ,
25 "_PATH_EXAMPLE.PY_COMPLETE": "complete_bash",
26 "COMP_WORDS": "path_example.py ",
27 "COMP_CWORD": "2",
28 },
29 )
30 assert result.returncode == 0 1abcdefgh