From 915e08aabc5ffbface1cae5110f2bdc731d25eba Mon Sep 17 00:00:00 2001 From: Ian Lee Date: Sat, 25 Jun 2016 15:37:55 -0700 Subject: Updated testsuite cases for #502 --- testsuite/E12not.py | 29 ++++++++++++----------------- testsuite/W19.py | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/testsuite/E12not.py b/testsuite/E12not.py index 65ba308..5c71360 100644 --- a/testsuite/E12not.py +++ b/testsuite/E12not.py @@ -16,12 +16,11 @@ if x == 2 \ or y > 1 \ or x == 3: pass - - +#: W503:2:9 if (foo == bar and baz == frop): pass - +#: W503:3:5 if ( foo == bar and baz == frop @@ -108,7 +107,7 @@ sat = 'AAA' \ 'BBB' \ 'iii' \ 'CCC' - +#: W504:1:12 W504:2:12 abricot = (3 + 4 + 5 + 6) @@ -137,8 +136,7 @@ def long_function_name( var_one, var_two, var_three, var_four): print(var_one) - - +#: W504:1:6 if ((row < 0 or self.moduleCount <= row or col < 0 or self.moduleCount <= col)): raise Exception("%s,%s - %s" % (row, col, self.moduleCount)) @@ -183,23 +181,23 @@ if bar: "to match that of the opening " "bracket's line" ) -# +#: W504:2:6 # you want vertical alignment, so use a parens if ((foo.bar("baz") and foo.bar("frop") )): print "yes" - +#: W504:2:6 # also ok, but starting to look like LISP if ((foo.bar("baz") and foo.bar("frop"))): print "yes" - +#: W504:1:5 if (a == 2 or b == "abc def ghi" "jkl mno"): return True - +#: W504:1:5 if (a == 2 or b == """abc def ghi jkl mno"""): @@ -223,16 +221,14 @@ print 'l.{line}\t{pos}\t{name}\t{text}'.format( print('%-7d %s per second (%d total)' % ( options.counters[key] / elapsed, key, options.counters[key])) - - +#: W504:2:12 if os.path.exists(os.path.join(path, PEP8_BIN)): cmd = ([os.path.join(path, PEP8_BIN)] + self._pep8_options(targetfile)) - - +#: W504:1:10 fixed = (re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] + target[c + 1:]) - +#: W504:2:5 fixed = ( re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] + target[c + 1:] @@ -423,8 +419,7 @@ add_option('--count', # - - +#: W504:1:9 help = ("print total number of errors " + "to standard error") diff --git a/testsuite/W19.py b/testsuite/W19.py index afdfb76..10d4be1 100644 --- a/testsuite/W19.py +++ b/testsuite/W19.py @@ -7,7 +7,7 @@ if False: #: W191 y = x == 2 \ or x == 3 -#: E101 W191 +#: E101 W191 W504 if ( x == ( 3 @@ -26,11 +26,11 @@ if x == 2 \ pass #: -#: E101 W191 +#: E101 W191 W504 if (foo == bar and baz == frop): pass -#: E101 W191 +#: E101 W191 W504 if ( foo == bar and baz == frop @@ -52,7 +52,7 @@ def long_function_name( var_one, var_two, var_three, var_four): print(var_one) -#: E101 W191 +#: E101 W191 W504 if ((row < 0 or self.moduleCount <= row or col < 0 or self.moduleCount <= col)): raise Exception("%s,%s - %s" % (row, col, self.moduleCount)) @@ -65,23 +65,23 @@ if bar: "bracket's line" ) # -#: E101 W191 +#: E101 W191 W504 # you want vertical alignment, so use a parens if ((foo.bar("baz") and foo.bar("frop") )): print "yes" -#: E101 W191 +#: E101 W191 W504 # also ok, but starting to look like LISP if ((foo.bar("baz") and foo.bar("frop"))): print "yes" -#: E101 W191 +#: E101 W191 W504 if (a == 2 or b == "abc def ghi" "jkl mno"): return True -#: E101 W191 +#: E101 W191 W504 if (a == 2 or b == """abc def ghi jkl mno"""): @@ -93,7 +93,7 @@ if length > options.max_line_length: # -#: E101 W191 W191 +#: E101 W191 W191 W504 if os.path.exists(os.path.join(path, PEP8_BIN)): cmd = ([os.path.join(path, PEP8_BIN)] + self._pep8_options(targetfile)) @@ -109,8 +109,8 @@ if os.path.exists(os.path.join(path, PEP8_BIN)): '''sometimes, you just need to go nuts in a multiline string and allow all sorts of crap like mixed tabs and spaces - -or trailing whitespace + +or trailing whitespace or long long long long long long long long long long long long long long long long long lines ''' # nopep8 #: Okay -- cgit v1.2.1