summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lee <IanLee1521@gmail.com>2016-06-25 15:37:55 -0700
committerIan Lee <IanLee1521@gmail.com>2016-06-25 20:37:21 -0700
commit915e08aabc5ffbface1cae5110f2bdc731d25eba (patch)
treef39849314f641d865ead4f2447661f2d3ceae41e
parentc2f607e5b2f1ae3da0a9c7609445d191dd471fcd (diff)
downloadpep8-915e08aabc5ffbface1cae5110f2bdc731d25eba.tar.gz
Updated testsuite cases for #502
-rw-r--r--testsuite/E12not.py29
-rw-r--r--testsuite/W19.py22
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