Skip to content

Commit 915e08a

Browse files
committed
Updated testsuite cases for #502
1 parent c2f607e commit 915e08a

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

testsuite/E12not.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
or y > 1 \
1717
or x == 3:
1818
pass
19-
20-
19+
#: W503:2:9
2120
if (foo == bar
2221
and baz == frop):
2322
pass
24-
23+
#: W503:3:5
2524
if (
2625
foo == bar
2726
and baz == frop
@@ -108,7 +107,7 @@
108107
'BBB' \
109108
'iii' \
110109
'CCC'
111-
110+
#: W504:1:12 W504:2:12
112111
abricot = (3 +
113112
4 +
114113
5 + 6)
@@ -137,8 +136,7 @@ def long_function_name(
137136
var_one, var_two, var_three,
138137
var_four):
139138
print(var_one)
140-
141-
139+
#: W504:1:6
142140
if ((row < 0 or self.moduleCount <= row or
143141
col < 0 or self.moduleCount <= col)):
144142
raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
@@ -183,23 +181,23 @@ def long_function_name(
183181
"to match that of the opening "
184182
"bracket's line"
185183
)
186-
#
184+
#: W504:2:6
187185
# you want vertical alignment, so use a parens
188186
if ((foo.bar("baz") and
189187
foo.bar("frop")
190188
)):
191189
print "yes"
192-
190+
#: W504:2:6
193191
# also ok, but starting to look like LISP
194192
if ((foo.bar("baz") and
195193
foo.bar("frop"))):
196194
print "yes"
197-
195+
#: W504:1:5
198196
if (a == 2 or
199197
b == "abc def ghi"
200198
"jkl mno"):
201199
return True
202-
200+
#: W504:1:5
203201
if (a == 2 or
204202
b == """abc def ghi
205203
jkl mno"""):
@@ -223,16 +221,14 @@ def long_function_name(
223221
print('%-7d %s per second (%d total)' % (
224222
options.counters[key] / elapsed, key,
225223
options.counters[key]))
226-
227-
224+
#: W504:2:12
228225
if os.path.exists(os.path.join(path, PEP8_BIN)):
229226
cmd = ([os.path.join(path, PEP8_BIN)] +
230227
self._pep8_options(targetfile))
231-
232-
228+
#: W504:1:10
233229
fixed = (re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] +
234230
target[c + 1:])
235-
231+
#: W504:2:5
236232
fixed = (
237233
re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] +
238234
target[c + 1:]
@@ -423,8 +419,7 @@ def unicode2html(s):
423419

424420

425421
#
426-
427-
422+
#: W504:1:9
428423
help = ("print total number of errors " +
429424
"to standard error")
430425

testsuite/W19.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#: W191
88
y = x == 2 \
99
or x == 3
10-
#: E101 W191
10+
#: E101 W191 W504
1111
if (
1212
x == (
1313
3
@@ -26,11 +26,11 @@
2626
pass
2727
#:
2828

29-
#: E101 W191
29+
#: E101 W191 W504
3030
if (foo == bar and
3131
baz == frop):
3232
pass
33-
#: E101 W191
33+
#: E101 W191 W504
3434
if (
3535
foo == bar and
3636
baz == frop
@@ -52,7 +52,7 @@ def long_function_name(
5252
var_one, var_two, var_three,
5353
var_four):
5454
print(var_one)
55-
#: E101 W191
55+
#: E101 W191 W504
5656
if ((row < 0 or self.moduleCount <= row or
5757
col < 0 or self.moduleCount <= col)):
5858
raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
@@ -65,23 +65,23 @@ def long_function_name(
6565
"bracket's line"
6666
)
6767
#
68-
#: E101 W191
68+
#: E101 W191 W504
6969
# you want vertical alignment, so use a parens
7070
if ((foo.bar("baz") and
7171
foo.bar("frop")
7272
)):
7373
print "yes"
74-
#: E101 W191
74+
#: E101 W191 W504
7575
# also ok, but starting to look like LISP
7676
if ((foo.bar("baz") and
7777
foo.bar("frop"))):
7878
print "yes"
79-
#: E101 W191
79+
#: E101 W191 W504
8080
if (a == 2 or
8181
b == "abc def ghi"
8282
"jkl mno"):
8383
return True
84-
#: E101 W191
84+
#: E101 W191 W504
8585
if (a == 2 or
8686
b == """abc def ghi
8787
jkl mno"""):
@@ -93,7 +93,7 @@ def long_function_name(
9393

9494

9595
#
96-
#: E101 W191 W191
96+
#: E101 W191 W191 W504
9797
if os.path.exists(os.path.join(path, PEP8_BIN)):
9898
cmd = ([os.path.join(path, PEP8_BIN)] +
9999
self._pep8_options(targetfile))
@@ -109,8 +109,8 @@ def long_function_name(
109109
'''sometimes, you just need to go nuts in a multiline string
110110
and allow all sorts of crap
111111
like mixed tabs and spaces
112-
113-
or trailing whitespace
112+
113+
or trailing whitespace
114114
or long long long long long long long long long long long long long long long long long lines
115115
''' # nopep8
116116
#: Okay

0 commit comments

Comments
 (0)