Coverage for tests / test_completion / test_completion_complete_no_help.py: 100%
17 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-03-26 21:46 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-03-26 21:46 +0000
1import os 1abcdefg
2import subprocess 1abcdefg
3import sys 1abcdefg
5from docs_src.commands.index import tutorial002_py310 as mod 1abcdefg
8def test_completion_complete_subcommand_zsh(): 1abcdefg
9 result = subprocess.run( 1abcdefg
10 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],
11 capture_output=True,
12 encoding="utf-8",
13 env={
14 **os.environ,
15 "_TUTORIAL002_PY310.PY_COMPLETE": "complete_zsh",
16 "_TYPER_COMPLETE_ARGS": "tutorial002_py310.py ",
17 },
18 )
19 assert "create" in result.stdout 1abcdefg
20 assert "delete" in result.stdout 1abcdefg
23def test_completion_complete_subcommand_fish(): 1abcdefg
24 result = subprocess.run( 1abcdefg
25 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],
26 capture_output=True,
27 encoding="utf-8",
28 env={
29 **os.environ,
30 "_TUTORIAL002_PY310.PY_COMPLETE": "complete_fish",
31 "_TYPER_COMPLETE_ARGS": "tutorial002_py310.py ",
32 "_TYPER_COMPLETE_FISH_ACTION": "get-args",
33 },
34 )
35 assert "create\ndelete" in result.stdout 1abcdefg
38def test_completion_complete_subcommand_powershell(): 1abcdefg
39 result = subprocess.run( 1abcdefg
40 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],
41 capture_output=True,
42 encoding="utf-8",
43 env={
44 **os.environ,
45 "_TUTORIAL002_PY310.PY_COMPLETE": "complete_powershell",
46 "_TYPER_COMPLETE_ARGS": "tutorial002_py310.py ",
47 },
48 )
49 assert ("create::: \ndelete::: ") in result.stdout 1abcdefg
52def test_completion_complete_subcommand_pwsh(): 1abcdefg
53 result = subprocess.run( 1abcdefg
54 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],
55 capture_output=True,
56 encoding="utf-8",
57 env={
58 **os.environ,
59 "_TUTORIAL002_PY310.PY_COMPLETE": "complete_pwsh",
60 "_TYPER_COMPLETE_ARGS": "tutorial002_py310.py ",
61 },
62 )
63 assert ("create::: \ndelete::: ") in result.stdout 1abcdefg