summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-09-05 11:51:38 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-09-05 11:51:38 -0400
commitf90c8d161437e2f289be2bb578973e3616b844c1 (patch)
tree7ef912d03741ce168e3a6037f929869be2d2b054 /cmd2/cmd2.py
parentf1e4fc3a90bad1c0d245af4c30fe4ec41a474ec9 (diff)
downloadcmd2-git-f90c8d161437e2f289be2bb578973e3616b844c1.tar.gz
Added pragma: no cover to some tab completion code
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 19f1e6e9..dd229c45 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1084,7 +1084,7 @@ class Cmd(cmd.Cmd):
tmp_line = line[:endidx]
tmp_line += unclosed_quote
tmp_endidx = endidx + 1
- else:
+ else: # pragma: no cover
# The parsing error is not caused by unclosed quotes.
# Return empty lists since this means the line is malformed.
return [], []
@@ -1199,7 +1199,7 @@ class Cmd(cmd.Cmd):
"""
# Get all tokens through the one being completed
tokens, _ = self.tokens_for_completion(line, begidx, endidx)
- if not tokens:
+ if not tokens: # pragma: no cover
return []
completions_matches = []
@@ -1241,7 +1241,7 @@ class Cmd(cmd.Cmd):
"""
# Get all tokens through the one being completed
tokens, _ = self.tokens_for_completion(line, begidx, endidx)
- if not tokens:
+ if not tokens: # pragma: no cover
return []
matches = []
@@ -1451,7 +1451,7 @@ class Cmd(cmd.Cmd):
# Get all tokens through the one being completed. We want the raw tokens
# so we can tell if redirection strings are quoted and ignore them.
_, raw_tokens = self.tokens_for_completion(line, begidx, endidx)
- if not raw_tokens:
+ if not raw_tokens: # pragma: no cover
return []
# Must at least have the command
@@ -1676,9 +1676,7 @@ class Cmd(cmd.Cmd):
# Get all tokens through the one being completed
tokens, raw_tokens = self.tokens_for_completion(line, begidx, endidx)
-
- # Check if we had a parsing error
- if len(tokens) == 0:
+ if not tokens: # pragma: no cover
return
# Determine the completer function to use