mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
fix: compatibility for Python 2.7
This commit is contained in:
@@ -47,6 +47,7 @@ if is_py2:
|
|||||||
integer_types = (int, long)
|
integer_types = (int, long)
|
||||||
|
|
||||||
FileNotFoundError = IOError
|
FileNotFoundError = IOError
|
||||||
|
import StringIO as io
|
||||||
|
|
||||||
elif is_py3:
|
elif is_py3:
|
||||||
builtin_str = str
|
builtin_str = str
|
||||||
@@ -57,3 +58,4 @@ elif is_py3:
|
|||||||
integer_types = (int,)
|
integer_types = (int,)
|
||||||
|
|
||||||
FileNotFoundError = FileNotFoundError
|
FileNotFoundError = FileNotFoundError
|
||||||
|
import io as io
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import io
|
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from httprunner.cli import main
|
from httprunner.cli import main
|
||||||
|
from httprunner.compat import io
|
||||||
|
|
||||||
|
|
||||||
class TestCli(unittest.TestCase):
|
class TestCli(unittest.TestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user