summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-05-09 12:26:23 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-05-09 12:26:23 +0200
commitdea188d1843186721db9d530bd62c906cc960089 (patch)
treead8d1625b8e03aadd5e25918c73355f00a5298c2
parent633d3f67b57b11d1f38a0ff57293ba25db690898 (diff)
downloadqutebrowser-dea188d1843186721db9d530bd62c906cc960089.tar.gz
qutebrowser-dea188d1843186721db9d530bd62c906cc960089.zip
Fix lint and coverage
-rw-r--r--qutebrowser/commands/cmdexc.py2
-rw-r--r--tests/unit/commands/test_cmdexc.py1
-rw-r--r--tests/unit/config/test_configexc.py1
3 files changed, 3 insertions, 1 deletions
diff --git a/qutebrowser/commands/cmdexc.py b/qutebrowser/commands/cmdexc.py
index 314bde84e..50488f1e5 100644
--- a/qutebrowser/commands/cmdexc.py
+++ b/qutebrowser/commands/cmdexc.py
@@ -36,7 +36,7 @@ class NoSuchCommandError(Error):
"""Raised when a command isn't found."""
@classmethod
- def for_cmd(cls, cmd: str, all_commands: List[str] = None) -> None:
+ def for_cmd(cls, cmd: str, all_commands: List[str] = None) -> "NoSuchCommandError":
"""Raise an exception for the given command."""
suffix = ''
if all_commands:
diff --git a/tests/unit/commands/test_cmdexc.py b/tests/unit/commands/test_cmdexc.py
index 817790a95..f80131e29 100644
--- a/tests/unit/commands/test_cmdexc.py
+++ b/tests/unit/commands/test_cmdexc.py
@@ -33,6 +33,7 @@ def test_empty_command_error():
@pytest.mark.parametrize("all_commands, msg", [
([], "testcmd: no such command"),
(["fastcmd"], "testcmd: no such command (did you mean :fastcmd?)"),
+ (["thisdoesnotmatch"], "testcmd: no such command"),
])
def test_no_such_command_error(all_commands, msg):
with pytest.raises(cmdexc.NoSuchCommandError, match=re.escape(msg)):
diff --git a/tests/unit/config/test_configexc.py b/tests/unit/config/test_configexc.py
index 0c64cf8c6..b289d3cc8 100644
--- a/tests/unit/config/test_configexc.py
+++ b/tests/unit/config/test_configexc.py
@@ -37,6 +37,7 @@ def test_validation_error():
(True, None, [], "No option 'opt' (this option was removed from qutebrowser)"),
(False, 'new', [], "No option 'opt' (this option was renamed to 'new')"),
(False, None, ["opto"], "No option 'opt' (did you mean 'opto'?)"),
+ (False, None, ["thisdoesnotmatch"], "No option 'opt'"),
(
True,
None,