We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7208c42 commit 0cbeccfCopy full SHA for 0cbeccf
tests/test_shtab.py
@@ -64,6 +64,24 @@ def test_main(shell, caplog):
64
assert not caplog.record_tuples
65
66
67
+@fix_shell
68
+def test_main_self_completion(shell, caplog, capsys):
69
+ with caplog.at_level(logging.INFO):
70
+ try:
71
+ main(["--print-completion", shell])
72
+ except SystemExit:
73
+ pass
74
+
75
+ captured = capsys.readouterr()
76
+ assert not captured.err
77
+ expected = {
78
+ "bash": "complete -o filenames -F _shtab_shtab shtab", "zsh": "_shtab_shtab_commands()",
79
+ "tcsh": "complete shtab"}
80
+ assert expected[shell] in captured.out
81
82
+ assert not caplog.record_tuples
83
84
85
@fix_shell
86
def test_prog_override(shell, caplog, capsys):
87
with caplog.at_level(logging.INFO):
0 commit comments