2020
2121import pytest_cov .plugin
2222
23- try :
24- from StringIO import StringIO
25- except ImportError :
26- from io import StringIO
23+ from io import StringIO
2724
2825coverage , platform # required for skipif mark on test_cov_min_from_coveragerc
2926
@@ -1240,8 +1237,7 @@ def test_run():
12401237 stdout, stderr = proc.communicate()
12411238 assert not stderr
12421239 assert stdout == b""
1243- # it appears signal handling is buggy on python 2?
1244- if sys.version_info == 3: assert proc.returncode in [128 + signal.SIGTERM, -signal.SIGTERM]
1240+ assert proc.returncode in [128 + signal.SIGTERM, -signal.SIGTERM]
12451241
12461242if __name__ == "__main__":
12471243 signal.signal(signal.SIGINT, signal.SIG_IGN)
@@ -1258,7 +1254,7 @@ def test_run():
12581254
12591255 result = testdir .runpytest ('-vv' , '--assert=plain' , f'--cov={ script .dirpath ()} ' , '--cov-report=term-missing' , script )
12601256
1261- result .stdout .fnmatch_lines (['*- coverage: platform *, python * -*' , 'test_cleanup_on_sigterm* 89% 23-24 ' , '*1 passed*' ])
1257+ result .stdout .fnmatch_lines (['*- coverage: platform *, python * -*' , 'test_cleanup_on_sigterm* 89% 22-23 ' , '*1 passed*' ])
12621258 assert result .ret == 0
12631259
12641260
@@ -1480,7 +1476,7 @@ def test_dist_boxed(testdir):
14801476
14811477
14821478@pytest .mark .skipif ('sys.platform == "win32"' )
1483- @pytest .mark .skipif ('sys.version_info[0] > 2 and platform.python_implementation() == "PyPy"' , reason = 'strange optimization on PyPy3' )
1479+ @pytest .mark .skipif ('platform.python_implementation() == "PyPy"' , reason = 'strange optimization on PyPy3' )
14841480def test_dist_bare_cov (testdir ):
14851481 script = testdir .makepyfile (SCRIPT_SIMPLE )
14861482
0 commit comments