diff --git a/httprunner/compat.py b/httprunner/compat.py index e7e92ca3..aa2a16ec 100644 --- a/httprunner/compat.py +++ b/httprunner/compat.py @@ -47,6 +47,7 @@ if is_py2: integer_types = (int, long) FileNotFoundError = IOError + import StringIO as io elif is_py3: builtin_str = str @@ -57,3 +58,4 @@ elif is_py3: integer_types = (int,) FileNotFoundError = FileNotFoundError + import io as io diff --git a/tests/test_cli.py b/tests/test_cli.py index 33914844..abf2a714 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,8 +1,8 @@ -import io import sys import unittest from httprunner.cli import main +from httprunner.compat import io class TestCli(unittest.TestCase):