diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py index d575117da..a4d127d0d 100644 --- a/tests/test_ext_napoleon_docstring.py +++ b/tests/test_ext_napoleon_docstring.py @@ -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)