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:
Steven Kryskalla 2012-02-23 15:03:21 -08:00
parent fdb1009fc1
commit 1d4e9a8968
2 changed files with 3 additions and 3 deletions

View file

@ -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,

View file

@ -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)