diff options
| author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-21 00:00:54 +0100 |
|---|---|---|
| committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-21 00:00:54 +0100 |
| commit | a593dd01a462eae39ec5786f13ff2c97622ac581 (patch) | |
| tree | 8ff3ebd1eb96e0c75b5c4706660850315781e462 /flake8/tests | |
| parent | 8af0f1ed98f8ce8555538747d4fdb60c1d2e45c4 (diff) | |
| download | flake8-a593dd01a462eae39ec5786f13ff2c97622ac581.tar.gz | |
Install mccabe as a dependency
Diffstat (limited to 'flake8/tests')
| -rw-r--r-- | flake8/tests/test_mccabe.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/flake8/tests/test_mccabe.py b/flake8/tests/test_mccabe.py deleted file mode 100644 index a220c83..0000000 --- a/flake8/tests/test_mccabe.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -import unittest -import sys -try: - from StringIO import StringIO -except ImportError: - from io import StringIO # NOQA - -from flake8.mccabe import get_code_complexity - - -_GLOBAL = """\ - -for i in range(10): - pass - -def a(): - def b(): - def c(): - pass - c() - b() - -""" - - -class McCabeTest(unittest.TestCase): - - def setUp(self): - self.old = sys.stdout - self.out = sys.stdout = StringIO() - - def tearDown(self): - sys.sdtout = self.old - - def test_sample(self): - self.assertEqual(get_code_complexity(_GLOBAL, 1), 2) - self.out.seek(0) - res = self.out.read().strip().split('\n') - wanted = ["stdin:5:1: C901 'a' is too complex (4)", - "stdin:2:1: C901 'Loop 2' is too complex (2)"] - self.assertEqual(res, wanted) |
