diff options
author | Brian Van Klaveren <bvan@slac.stanford.edu> | 2018-05-11 09:40:22 -0700 |
---|---|---|
committer | Brian Van Klaveren <bvan@slac.stanford.edu> | 2018-05-11 09:40:22 -0700 |
commit | 6ef3190960039fc9749ebf7d92bb1290dad47de3 (patch) | |
tree | 4b179694141f03a93fd1de6d14f6089fcccf8feb /testsuite | |
parent | f6139a8e47dba691046ef82b6ab9b29e3bf38690 (diff) | |
download | pep8-6ef3190960039fc9749ebf7d92bb1290dad47de3.tar.gz |
Pydoc fixes to support W505 in self-checks
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/support.py | 8 | ||||
-rw-r--r-- | testsuite/test_blank_lines.py | 70 |
2 files changed, 40 insertions, 38 deletions
diff --git a/testsuite/support.py b/testsuite/support.py index 825def1..bcca4e4 100644 --- a/testsuite/support.py +++ b/testsuite/support.py @@ -151,11 +151,11 @@ def init_tests(pep8style): A test file can provide many tests. Each test starts with a declaration. This declaration is a single line starting with '#:'. - It declares codes of expected failures, separated by spaces or 'Okay' - if no failure is expected. + It declares codes of expected failures, separated by spaces or + 'Okay' if no failure is expected. If the file does not contain such declaration, it should pass all - tests. If the declaration is empty, following lines are not checked, - until next declaration. + tests. If the declaration is empty, following lines are not + checked, until next declaration. Examples: diff --git a/testsuite/test_blank_lines.py b/testsuite/test_blank_lines.py index 870403a..2b37ad1 100644 --- a/testsuite/test_blank_lines.py +++ b/testsuite/test_blank_lines.py @@ -35,8 +35,8 @@ class BlankLinesTestCase(unittest.TestCase): class TestBlankLinesDefault(BlankLinesTestCase): """ - Tests for default blank with 2 blank lines for top level and 1 blank line - for methods. + Tests for default blank with 2 blank lines for top level and 1 + blank line for methods. """ def test_initial_no_blank(self): @@ -51,8 +51,8 @@ class TestBlankLinesDefault(BlankLinesTestCase): def test_initial_lines_one_blank(self): """ - It will accept 1 blank lines before the first line of actual code, - even if in other places it asks for 2 + It will accept 1 blank lines before the first line of actual + code, even if in other places it asks for 2 """ result = self.check(""" def some_function(): @@ -63,8 +63,8 @@ def some_function(): def test_initial_lines_two_blanks(self): """ - It will accept 2 blank lines before the first line of actual code, - as normal. + It will accept 2 blank lines before the first line of actual + code, as normal. """ result = self.check(""" @@ -76,8 +76,8 @@ def some_function(): def test_method_less_blank_lines(self): """ - It will trigger an error when less than 1 blank lin is found before - method definitions. + It will trigger an error when less than 1 blank lin is found + before method definitions. """ result = self.check("""# First comment line. class X: @@ -93,8 +93,8 @@ class X: def test_method_less_blank_lines_comment(self): """ - It will trigger an error when less than 1 blank lin is found before - method definition, ignoring comments. + It will trigger an error when less than 1 blank lin is found + before method definition, ignoring comments. """ result = self.check("""# First comment line. class X: @@ -111,8 +111,8 @@ class X: def test_top_level_fewer_blank_lines(self): """ - It will trigger an error when less 2 blank lines are found before top - level definitions. + It will trigger an error when less 2 blank lines are found + before top level definitions. """ result = self.check("""# First comment line. # Second line of comment. @@ -146,8 +146,8 @@ class AFarEnoughClass(object): def test_top_level_more_blank_lines(self): """ - It will trigger an error when more 2 blank lines are found before top - level definitions. + It will trigger an error when more 2 blank lines are found + before top level definitions. """ result = self.check("""# First comment line. # Second line of comment. @@ -177,8 +177,8 @@ class AFarEnoughClass(object): def test_method_more_blank_lines(self): """ - It will trigger an error when more than 1 blank line is found before - method definition + It will trigger an error when more than 1 blank line is found + before method definition """ result = self.check("""# First comment line. @@ -209,8 +209,8 @@ class SomeCloseClass(object): def test_initial_lines_more_blank(self): """ - It will trigger an error for more than 2 blank lines before the first - line of actual code. + It will trigger an error for more than 2 blank lines before the + first line of actual code. """ result = self.check(""" @@ -222,8 +222,8 @@ def some_function(): def test_blank_line_between_decorator(self): """ - It will trigger an error when the decorator is followed by a blank - line. + It will trigger an error when the decorator is followed by a + blank line. """ result = self.check("""# First line. @@ -245,8 +245,8 @@ class SomeClass(object): def test_blank_line_decorator(self): """ - It will accept the decorators which are adjacent to the function and - method definition. + It will accept the decorators which are adjacent to the function + and method definition. """ result = self.check("""# First line. @@ -340,7 +340,8 @@ def a(): def test_method_nested_fewer_follow_lines(self): """ It will trigger an error when less than 1 blank line is - found between a method and previous definitions, even when nested. + found between a method and previous definitions, even when + nested. """ result = self.check(""" def a(): @@ -374,7 +375,8 @@ def a(): def test_method_nested_ok(self): """ Will not trigger an error when 1 blank line is found - found between a method and previous definitions, even when nested. + found between a method and previous definitions, even when + nested. """ result = self.check(""" def a(): @@ -394,8 +396,8 @@ def a(): class TestBlankLinesTwisted(BlankLinesTestCase): """ - Tests for blank_lines with 3 blank lines for top level and 2 blank line - for methods as used by the Twisted coding style. + Tests for blank_lines with 3 blank lines for top level and 2 blank + line for methods as used by the Twisted coding style. """ def setUp(self): @@ -408,8 +410,8 @@ class TestBlankLinesTwisted(BlankLinesTestCase): def test_initial_lines_one_blanks(self): """ - It will accept less than 3 blank lines before the first line of actual - code. + It will accept less than 3 blank lines before the first line of + actual code. """ result = self.check(""" @@ -422,8 +424,8 @@ def some_function(): def test_initial_lines_tree_blanks(self): """ - It will accept 3 blank lines before the first line of actual code, - as normal. + It will accept 3 blank lines before the first line of actual + code, as normal. """ result = self.check(""" @@ -436,8 +438,8 @@ def some_function(): def test_top_level_fewer_blank_lines(self): """ - It will trigger an error when less 2 blank lines are found before top - level definitions. + It will trigger an error when less 2 blank lines are found + before top level definitions. """ result = self.check("""# First comment line. # Second line of comment. @@ -476,8 +478,8 @@ class AFarEnoughClass(object): def test_top_level_more_blank_lines(self): """ - It will trigger an error when more 2 blank lines are found before top - level definitions. + It will trigger an error when more 2 blank lines are found + before top level definitions. """ result = self.check("""# First comment line. # Second line of comment. |