From 1d4e9a8968c532a473cecdbf9ea7d9420a8e5a67 Mon Sep 17 00:00:00 2001 From: Steven Kryskalla Date: Thu, 23 Feb 2012 15:03:21 -0800 Subject: [PATCH] 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 --- flake8/mccabe.py | 2 +- flake8/tests/test_mccabe.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flake8/mccabe.py b/flake8/mccabe.py index c41334c..5e55f2f 100644 --- a/flake8/mccabe.py +++ b/flake8/mccabe.py @@ -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, diff --git a/flake8/tests/test_mccabe.py b/flake8/tests/test_mccabe.py index 42032f2..887599f 100644 --- a/flake8/tests/test_mccabe.py +++ b/flake8/tests/test_mccabe.py @@ -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)