Fix flake8 violations

This commit is contained in:
Takeshi KOMIYA 2018-02-20 00:08:44 +09:00
parent 938ba386ed
commit 4073d4e850

View File

@ -289,10 +289,10 @@ class GoogleDocstringTest(BaseDocstringTest):
for section, admonition in admonition_map.items():
# Multiline
actual = str(GoogleDocstring(("{}:\n"
" this is the first line\n"
"\n"
" and this is the second line\n"
).format(section), config))
" this is the first line\n"
"\n"
" and this is the second line\n"
).format(section), config))
expect = (".. {}::\n"
"\n"
" this is the first line\n"
@ -303,13 +303,12 @@ class GoogleDocstringTest(BaseDocstringTest):
# Single line
actual = str(GoogleDocstring(("{}:\n"
" this is a single line\n"
).format(section), config))
" this is a single line\n"
).format(section), config))
expect = (".. {}:: this is a single line\n"
).format(admonition)
self.assertEqual(expect, actual)
def test_docstrings(self):
config = Config(
napoleon_use_param=False,
@ -967,21 +966,21 @@ Parameters:
def test_custom_generic_sections(self):
docstrings=("""\
docstrings = (("""\
Really Important Details:
You should listen to me!
""",
""".. rubric:: Really Important Details
""", """.. rubric:: Really Important Details
You should listen to me!
"""),\
("""\
"""),
("""\
Sooper Warning:
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:
actual = str(GoogleDocstring(docstring, testConfig))
@ -1159,11 +1158,11 @@ class NumpyDocstringTest(BaseDocstringTest):
for section, admonition in admonition_map.items():
# Multiline
actual = str(NumpyDocstring(("{}\n"
"{}\n"
" this is the first line\n"
"\n"
" and this is the second line\n"
).format(section, '-'*len(section)), config))
"{}\n"
" this is the first line\n"
"\n"
" and this is the second line\n"
).format(section, '-' * len(section)), config))
expect = (".. {}::\n"
"\n"
" this is the first line\n"
@ -1174,9 +1173,9 @@ class NumpyDocstringTest(BaseDocstringTest):
# Single line
actual = str(NumpyDocstring(("{}\n"
"{}\n"
" this is a single line\n"
).format(section, '-'*len(section)), config))
"{}\n"
" this is a single line\n"
).format(section, '-' * len(section)), config))
expect = (".. {}:: this is a single line\n"
).format(admonition)
self.assertEqual(expect, actual)