mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-31 11:16:54 +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
|
||||
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,
|
||||
graph.lineno,
|
||||
WARNING_CODE,
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ class McCabeTest(unittest.TestCase):
|
|||
self.assertEqual(get_code_complexity(_GLOBAL, 1), 2)
|
||||
self.out.seek(0)
|
||||
res = self.out.read().strip().split('\n')
|
||||
wanted = ["stdin:5:1: 'a' is too complex (4)",
|
||||
'stdin:Loop 2 is too complex (2)']
|
||||
wanted = ["stdin:5:1: W901 'a' is too complex (4)",
|
||||
"stdin:2:1: W901 'Loop 2' is too complex (2)"]
|
||||
self.assertEqual(res, wanted)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue