|
@@ -4,7 +4,12 @@
|
|
|
|
|
|
import unittest
|
|
|
|
|
|
-import StringIO
|
|
|
+try:
|
|
|
+
|
|
|
+ from StringIO import StringIO
|
|
|
+except ImportError:
|
|
|
+
|
|
|
+ from io import StringIO
|
|
|
|
|
|
import metrics
|
|
|
|
|
@@ -38,7 +43,7 @@ fun,(
|
|
|
|
|
|
class TestFunctionLength(unittest.TestCase):
|
|
|
def test_function_length(self):
|
|
|
- funcs = StringIO.StringIO(function_file)
|
|
|
+ funcs = StringIO(function_file)
|
|
|
|
|
|
for name, lines in metrics.get_function_lines(funcs):
|
|
|
self.assertEqual(name, "fun")
|
|
@@ -50,7 +55,7 @@ class TestFunctionLength(unittest.TestCase):
|
|
|
|
|
|
class TestIncludeCount(unittest.TestCase):
|
|
|
def test_include_count(self):
|
|
|
- f = StringIO.StringIO("""
|
|
|
+ f = StringIO("""
|
|
|
|
|
|
|
|
|
|