Added test case

This commit is contained in:
James Parkhurst 2022-04-04 11:45:58 +01:00
parent 75a3b92690
commit 88b213bbf0
3 changed files with 17 additions and 0 deletions

View File

@ -26,3 +26,11 @@ def _func_int(arg, kwarg=None):
def _func_str(arg, kwarg=None):
"""A function for str."""
pass
@func.register
def _func_dict(arg: dict, kwarg=None):
"""A function for dict."""
# This function tests for specifying type through annotations
pass

View File

@ -19,3 +19,9 @@ class Foo:
def _meth_str(self, arg, kwarg=None):
"""A method for str."""
pass
@meth.register
def _meth_dict(self, arg: dict, kwarg=None):
"""A method for dict."""
# This function tests for specifying type through annotations
pass

View File

@ -2073,6 +2073,7 @@ def test_singledispatch(app):
' func(arg: float, kwarg=None)',
' func(arg: int, kwarg=None)',
' func(arg: str, kwarg=None)',
' func(arg: dict, kwarg=None)',
' :module: target.singledispatch',
'',
' A function for general use.',
@ -2101,6 +2102,7 @@ def test_singledispatchmethod(app):
' Foo.meth(arg: float, kwarg=None)',
' Foo.meth(arg: int, kwarg=None)',
' Foo.meth(arg: str, kwarg=None)',
' Foo.meth(arg: dict, kwarg=None)',
' :module: target.singledispatchmethod',
'',
' A method for general use.',
@ -2120,6 +2122,7 @@ def test_singledispatchmethod_automethod(app):
' Foo.meth(arg: float, kwarg=None)',
' Foo.meth(arg: int, kwarg=None)',
' Foo.meth(arg: str, kwarg=None)',
' Foo.meth(arg: dict, kwarg=None)',
' :module: target.singledispatchmethod',
'',
' A method for general use.',