mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
move the GoogleDocstring test to the appropriate test class
This commit is contained in:
parent
278a057104
commit
2c75aaaa54
@ -1078,6 +1078,22 @@ Methods:
|
|||||||
options={'noindex': True}))
|
options={'noindex': True}))
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
|
def test_keywords_with_types(self):
|
||||||
|
docstring = """\
|
||||||
|
Do as you please
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
gotham_is_yours (None): shall interfere.
|
||||||
|
"""
|
||||||
|
actual = str(GoogleDocstring(docstring))
|
||||||
|
expected = """\
|
||||||
|
Do as you please
|
||||||
|
|
||||||
|
:keyword gotham_is_yours: shall interfere.
|
||||||
|
:kwtype gotham_is_yours: None
|
||||||
|
"""
|
||||||
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
|
|
||||||
class NumpyDocstringTest(BaseDocstringTest):
|
class NumpyDocstringTest(BaseDocstringTest):
|
||||||
docstrings = [(
|
docstrings = [(
|
||||||
@ -2191,22 +2207,6 @@ definition_after_normal_text : int
|
|||||||
actual = str(NumpyDocstring(docstring, config))
|
actual = str(NumpyDocstring(docstring, config))
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
def test_keywords_with_types(self):
|
|
||||||
docstring = """\
|
|
||||||
Do as you please
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
gotham_is_yours (None): shall interfere.
|
|
||||||
"""
|
|
||||||
actual = str(GoogleDocstring(docstring))
|
|
||||||
expected = """\
|
|
||||||
Do as you please
|
|
||||||
|
|
||||||
:keyword gotham_is_yours: shall interfere.
|
|
||||||
:kwtype gotham_is_yours: None
|
|
||||||
"""
|
|
||||||
self.assertEqual(expected, actual)
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def warns(warning, match):
|
def warns(warning, match):
|
||||||
match_re = re.compile(match)
|
match_re = re.compile(match)
|
||||||
|
Loading…
Reference in New Issue
Block a user