20
20
21
21
import pytest_cov .plugin
22
22
23
- try :
24
- from StringIO import StringIO
25
- except ImportError :
26
- from io import StringIO
23
+ from io import StringIO
27
24
28
25
coverage , platform # required for skipif mark on test_cov_min_from_coveragerc
29
26
@@ -1240,8 +1237,7 @@ def test_run():
1240
1237
stdout, stderr = proc.communicate()
1241
1238
assert not stderr
1242
1239
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]
1245
1241
1246
1242
if __name__ == "__main__":
1247
1243
signal.signal(signal.SIGINT, signal.SIG_IGN)
@@ -1258,7 +1254,7 @@ def test_run():
1258
1254
1259
1255
result = testdir .runpytest ('-vv' , '--assert=plain' , f'--cov={ script .dirpath ()} ' , '--cov-report=term-missing' , script )
1260
1256
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*' ])
1262
1258
assert result .ret == 0
1263
1259
1264
1260
@@ -1480,7 +1476,7 @@ def test_dist_boxed(testdir):
1480
1476
1481
1477
1482
1478
@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' )
1484
1480
def test_dist_bare_cov (testdir ):
1485
1481
script = testdir .makepyfile (SCRIPT_SIMPLE )
1486
1482
0 commit comments