Skip to content

Commit

Permalink
Updated testsuite cases for #502
Browse files Browse the repository at this point in the history
  • Loading branch information
IanLee1521 committed Jun 26, 2016
1 parent c2f607e commit 915e08a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
29 changes: 12 additions & 17 deletions testsuite/E12not.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
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
Expand Down Expand Up @@ -108,7 +107,7 @@
'BBB' \
'iii' \
'CCC'

#: W504:1:12 W504:2:12
abricot = (3 +
4 +
5 + 6)
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -183,23 +181,23 @@ def long_function_name(
"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"""):
Expand All @@ -223,16 +221,14 @@ def long_function_name(
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:]
Expand Down Expand Up @@ -423,8 +419,7 @@ def unicode2html(s):


#


#: W504:1:9
help = ("print total number of errors " +
"to standard error")

Expand Down
22 changes: 11 additions & 11 deletions testsuite/W19.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#: W191
y = x == 2 \
or x == 3
#: E101 W191
#: E101 W191 W504
if (
x == (
3
Expand All @@ -26,11 +26,11 @@
pass
#:

#: E101 W191
#: E101 W191 W504
if (foo == bar and
baz == frop):
pass
#: E101 W191
#: E101 W191 W504
if (
foo == bar and
baz == frop
Expand All @@ -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))
Expand All @@ -65,23 +65,23 @@ def long_function_name(
"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"""):
Expand All @@ -93,7 +93,7 @@ def long_function_name(


#
#: 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))
Expand All @@ -109,8 +109,8 @@ def long_function_name(
'''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
Expand Down

0 comments on commit 915e08a

Please sign in to comment.