mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix flake8 violations
This commit is contained in:
parent
938ba386ed
commit
4073d4e850
@ -289,10 +289,10 @@ class GoogleDocstringTest(BaseDocstringTest):
|
|||||||
for section, admonition in admonition_map.items():
|
for section, admonition in admonition_map.items():
|
||||||
# Multiline
|
# Multiline
|
||||||
actual = str(GoogleDocstring(("{}:\n"
|
actual = str(GoogleDocstring(("{}:\n"
|
||||||
" this is the first line\n"
|
" this is the first line\n"
|
||||||
"\n"
|
"\n"
|
||||||
" and this is the second line\n"
|
" and this is the second line\n"
|
||||||
).format(section), config))
|
).format(section), config))
|
||||||
expect = (".. {}::\n"
|
expect = (".. {}::\n"
|
||||||
"\n"
|
"\n"
|
||||||
" this is the first line\n"
|
" this is the first line\n"
|
||||||
@ -303,13 +303,12 @@ class GoogleDocstringTest(BaseDocstringTest):
|
|||||||
|
|
||||||
# Single line
|
# Single line
|
||||||
actual = str(GoogleDocstring(("{}:\n"
|
actual = str(GoogleDocstring(("{}:\n"
|
||||||
" this is a single line\n"
|
" this is a single line\n"
|
||||||
).format(section), config))
|
).format(section), config))
|
||||||
expect = (".. {}:: this is a single line\n"
|
expect = (".. {}:: this is a single line\n"
|
||||||
).format(admonition)
|
).format(admonition)
|
||||||
self.assertEqual(expect, actual)
|
self.assertEqual(expect, actual)
|
||||||
|
|
||||||
|
|
||||||
def test_docstrings(self):
|
def test_docstrings(self):
|
||||||
config = Config(
|
config = Config(
|
||||||
napoleon_use_param=False,
|
napoleon_use_param=False,
|
||||||
@ -967,21 +966,21 @@ Parameters:
|
|||||||
|
|
||||||
def test_custom_generic_sections(self):
|
def test_custom_generic_sections(self):
|
||||||
|
|
||||||
docstrings=("""\
|
docstrings = (("""\
|
||||||
Really Important Details:
|
Really Important Details:
|
||||||
You should listen to me!
|
You should listen to me!
|
||||||
""",
|
""", """.. rubric:: Really Important Details
|
||||||
""".. rubric:: Really Important Details
|
|
||||||
|
|
||||||
You should listen to me!
|
You should listen to me!
|
||||||
"""),\
|
"""),
|
||||||
("""\
|
("""\
|
||||||
Sooper Warning:
|
Sooper Warning:
|
||||||
Stop hitting yourself!
|
Stop hitting yourself!
|
||||||
""",""":Warns: **Stop hitting yourself!**
|
""", """:Warns: **Stop hitting yourself!**
|
||||||
""")
|
"""))
|
||||||
|
|
||||||
testConfig=Config(napoleon_custom_sections=['Really Important Details',('Sooper Warning','warns')])
|
testConfig = Config(napoleon_custom_sections=['Really Important Details',
|
||||||
|
('Sooper Warning', 'warns')])
|
||||||
|
|
||||||
for docstring, expected in docstrings:
|
for docstring, expected in docstrings:
|
||||||
actual = str(GoogleDocstring(docstring, testConfig))
|
actual = str(GoogleDocstring(docstring, testConfig))
|
||||||
@ -1159,11 +1158,11 @@ class NumpyDocstringTest(BaseDocstringTest):
|
|||||||
for section, admonition in admonition_map.items():
|
for section, admonition in admonition_map.items():
|
||||||
# Multiline
|
# Multiline
|
||||||
actual = str(NumpyDocstring(("{}\n"
|
actual = str(NumpyDocstring(("{}\n"
|
||||||
"{}\n"
|
"{}\n"
|
||||||
" this is the first line\n"
|
" this is the first line\n"
|
||||||
"\n"
|
"\n"
|
||||||
" and this is the second line\n"
|
" and this is the second line\n"
|
||||||
).format(section, '-'*len(section)), config))
|
).format(section, '-' * len(section)), config))
|
||||||
expect = (".. {}::\n"
|
expect = (".. {}::\n"
|
||||||
"\n"
|
"\n"
|
||||||
" this is the first line\n"
|
" this is the first line\n"
|
||||||
@ -1174,9 +1173,9 @@ class NumpyDocstringTest(BaseDocstringTest):
|
|||||||
|
|
||||||
# Single line
|
# Single line
|
||||||
actual = str(NumpyDocstring(("{}\n"
|
actual = str(NumpyDocstring(("{}\n"
|
||||||
"{}\n"
|
"{}\n"
|
||||||
" this is a single line\n"
|
" this is a single line\n"
|
||||||
).format(section, '-'*len(section)), config))
|
).format(section, '-' * len(section)), config))
|
||||||
expect = (".. {}:: this is a single line\n"
|
expect = (".. {}:: this is a single line\n"
|
||||||
).format(admonition)
|
).format(admonition)
|
||||||
self.assertEqual(expect, actual)
|
self.assertEqual(expect, actual)
|
||||||
|
Loading…
Reference in New Issue
Block a user