Exemplo n.º 1
0
    def test_typed_keyword_only_without_default(self):
        # https://github.com/qutebrowser/qutebrowser/issues/1872
        def fun(*, target: int):
            """Blah."""
            pass

        with pytest.raises(TypeError, match="fun: handler has keyword only "
                           "argument 'target' without default!"):
            fun = cmdutils.register()(fun)
Exemplo n.º 2
0
    def test_typed_keyword_only_without_default(self):
        # https://github.com/qutebrowser/qutebrowser/issues/1872
        def fun(*, target: int):
            """Blah."""
            pass

        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
Exemplo n.º 3
0
    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) as excinfo:
            fun = cmdutils.register()(fun)

        expected = ("fun: handler has keyword only argument 'target' without "
                    "default!")
        assert str(excinfo.value) == expected