tests: make sure the type error is the one we want
This commit is contained in:
parent
794eb84805
commit
eabfdb3c16
@ -355,18 +355,27 @@ class TestRegister:
|
||||
"""Blah."""
|
||||
pass
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
with pytest.raises(TypeError) as excinfo:
|
||||
fun = cmdutils.register()(fun)
|
||||
|
||||
expected = ("fun: handler has keyword only argument 'target' without "
|
||||
"default!")
|
||||
assert str(excinfo.value) == expected
|
||||
|
||||
|
||||
def test_typed_keyword_only_without_default(self):
|
||||
# https://github.com/The-Compiler/qutebrowser/issues/1872
|
||||
def fun(*, target: int):
|
||||
"""Blah."""
|
||||
pass
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
with pytest.raises(TypeError) as excinfo:
|
||||
fun = cmdutils.register()(fun)
|
||||
|
||||
expected = ("fun: handler has keyword only argument 'target' without "
|
||||
"default!")
|
||||
assert str(excinfo.value) == expected
|
||||
|
||||
|
||||
class TestArgument:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user