diff options
author | Anthony Sottile <asottile@umich.edu> | 2020-03-23 10:51:41 -0700 |
---|---|---|
committer | Anthony Sottile <asottile@umich.edu> | 2020-03-23 10:51:41 -0700 |
commit | 7e3655b9655ed8a13daa65c6cd2f38a06bfa5469 (patch) | |
tree | 0215793a881dc536d23501b10e9bc0a41e6a8182 /testsuite | |
parent | 19a3925a89c71d422b98363d9ccfa8903a65b707 (diff) | |
download | pep8-7e3655b9655ed8a13daa65c6cd2f38a06bfa5469.tar.gz |
Allow N-and-fewer blank lines before the first top level thing
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/E30.py | 5 | ||||
-rw-r--r-- | testsuite/E30not.py | 10 | ||||
-rw-r--r-- | testsuite/test_blank_lines.py | 4 |
3 files changed, 11 insertions, 8 deletions
diff --git a/testsuite/E30.py b/testsuite/E30.py index 15fbdf3..8d1879b 100644 --- a/testsuite/E30.py +++ b/testsuite/E30.py @@ -16,11 +16,6 @@ class X: #: -#: E302:3:1 -#!python -# -*- coding: utf-8 -*- -def a(): - pass #: E302:2:1 """Main module.""" def _main(): diff --git a/testsuite/E30not.py b/testsuite/E30not.py index ba0f742..a86b99e 100644 --- a/testsuite/E30not.py +++ b/testsuite/E30not.py @@ -177,3 +177,13 @@ def foo(): # for no E30x being emitted. def bar(): pass def baz(): pass +#: Okay +#!python +# -*- coding: utf-8 -*- +def a(): + pass +#: Okay +def f( + a, +): + pass diff --git a/testsuite/test_blank_lines.py b/testsuite/test_blank_lines.py index 2b37ad1..e239f8b 100644 --- a/testsuite/test_blank_lines.py +++ b/testsuite/test_blank_lines.py @@ -139,7 +139,6 @@ class AFarEnoughClass(object): pass """) self.assertEqual([ - 'E302:4:1', # some_function 'E302:7:1', # another_function 'E302:14:1', # SomeCloseClass ], result) @@ -438,7 +437,7 @@ def some_function(): def test_top_level_fewer_blank_lines(self): """ - It will trigger an error when less 2 blank lines are found + It will trigger an error when less 3 blank lines are found before top level definitions. """ result = self.check("""# First comment line. @@ -471,7 +470,6 @@ class AFarEnoughClass(object): pass """) self.assertEqual([ - 'E302:5:1', # some_function 'E302:9:1', # another_function 'E302:17:1', # SomeCloseClass ], result) |