mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-10 14:54:17 +00:00
mccabe warning message was missing a ":" after the column number
update tests to match the new format with the warning code tests pass in python 2.7 and 3.2
This commit is contained in:
parent
fdb1009fc1
commit
1d4e9a8968
2 changed files with 3 additions and 3 deletions
|
|
@ -243,7 +243,7 @@ def get_code_complexity(code, min=7, filename='stdin'):
|
||||||
# ?
|
# ?
|
||||||
continue
|
continue
|
||||||
if graph.complexity() >= min:
|
if graph.complexity() >= min:
|
||||||
msg = '%s:%d:1 %s %r is too complex (%d)' % (
|
msg = '%s:%d:1: %s %r is too complex (%d)' % (
|
||||||
filename,
|
filename,
|
||||||
graph.lineno,
|
graph.lineno,
|
||||||
WARNING_CODE,
|
WARNING_CODE,
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,6 @@ class McCabeTest(unittest.TestCase):
|
||||||
self.assertEqual(get_code_complexity(_GLOBAL, 1), 2)
|
self.assertEqual(get_code_complexity(_GLOBAL, 1), 2)
|
||||||
self.out.seek(0)
|
self.out.seek(0)
|
||||||
res = self.out.read().strip().split('\n')
|
res = self.out.read().strip().split('\n')
|
||||||
wanted = ["stdin:5:1: 'a' is too complex (4)",
|
wanted = ["stdin:5:1: W901 'a' is too complex (4)",
|
||||||
'stdin:Loop 2 is too complex (2)']
|
"stdin:2:1: W901 'Loop 2' is too complex (2)"]
|
||||||
self.assertEqual(res, wanted)
|
self.assertEqual(res, wanted)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue