diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2014-04-14 16:23:12 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2014-04-14 16:23:12 +0200 |
commit | b6da3926871b581d5ff2b5635777de71748ecb24 (patch) | |
tree | 8317b2b856f669bbf63f87a962bc857dd985bea0 /testsuite | |
parent | 74996fe0ad4c881bdd6d139129aa9e83a35cf935 (diff) | |
download | pep8-b6da3926871b581d5ff2b5635777de71748ecb24.tar.gz |
Check the last line even if it has not EOL; issue #273
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/W29.py | 14 | ||||
-rw-r--r-- | testsuite/support.py | 5 |
2 files changed, 13 insertions, 6 deletions
diff --git a/testsuite/W29.py b/testsuite/W29.py index 42802ca..688667f 100644 --- a/testsuite/W29.py +++ b/testsuite/W29.py @@ -1,13 +1,17 @@ #: Okay # 情 -#: W291 +#: W291:1:6 print -#: W293 +#: W293:2:1 class Foo(object): bang = 12 -#: W291 +#: W291:2:35 '''multiline string with trailing whitespace''' -#: W292 -# This line doesn't have a linefeed
\ No newline at end of file +#: W292:1:36 noeol +# This line doesn't have a linefeed +#: W292:1:5 E225:1:2 noeol +1+ 1 +#: W292:1:27 E261:1:12 noeol +import this # no line feed diff --git a/testsuite/support.py b/testsuite/support.py index 3c767ed..5185005 100644 --- a/testsuite/support.py +++ b/testsuite/support.py @@ -157,7 +157,10 @@ def init_tests(pep8style): testcase.append(line) continue if codes and index: - codes = [c for c in codes if c != 'Okay'] + if 'noeol' in codes: + testcase[-1] = testcase[-1].rstrip('\n') + codes = [c for c in codes + if c not in ('Okay', 'noeol')] # Run the checker runner(filename, testcase, expected=codes, line_offset=line_offset) |