mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Added test case
This commit is contained in:
parent
75a3b92690
commit
88b213bbf0
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.',
|
||||
|
Loading…
Reference in New Issue
Block a user