Skip to content

Commit 419a010

Browse files
nedbationelmc
authored andcommitted
No need to skip for coverage < 4, we don't support coverage < 4
1 parent f4a4a29 commit 419a010

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/pytest_cov/engine.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ def summary(self, stream):
130130
'file': stream,
131131
}
132132
skip_covered = isinstance(self.cov_report, dict) and 'skip-covered' in self.cov_report.values()
133-
if hasattr(coverage, 'version_info') and coverage.version_info[0] >= 4:
134-
options.update({'skip_covered': skip_covered or None})
133+
options.update({'skip_covered': skip_covered or None})
135134
with _backup(self.cov, "config"):
136135
total = self.cov.report(**options)
137136

tests/test_pytest_cov.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import platform
44
import subprocess
55
import sys
6-
from distutils.version import StrictVersion
76
from itertools import chain
87

98
import coverage
@@ -25,7 +24,7 @@
2524
import pytest_cov.plugin
2625
from pytest_cov import compat
2726

28-
coverage, platform, StrictVersion # required for skipif mark on test_cov_min_from_coveragerc
27+
coverage, platform # required for skipif mark on test_cov_min_from_coveragerc
2928

3029
max_worker_restart_0 = "--max-" + compat.worker + "-restart=0"
3130

@@ -468,7 +467,6 @@ def test_central_nonspecific(testdir, prop):
468467
assert result.ret == 0
469468

470469

471-
@pytest.mark.skipif('StrictVersion(coverage.__version__) <= StrictVersion("3.8")')
472470
def test_cov_min_from_coveragerc(testdir):
473471
script = testdir.makepyfile(SCRIPT)
474472
testdir.tmpdir.join('.coveragerc').write("""
@@ -1636,7 +1634,6 @@ def test_basic():
16361634
SKIP_COVERED_RESULT = '1 file skipped due to complete coverage.'
16371635

16381636

1639-
@pytest.mark.skipif('StrictVersion(coverage.__version__) < StrictVersion("4.0")')
16401637
@pytest.mark.parametrize('report_option', [
16411638
'term-missing:skip-covered',
16421639
'term:skip-covered'])
@@ -1651,7 +1648,6 @@ def test_skip_covered_cli(testdir, report_option):
16511648
result.stdout.fnmatch_lines([SKIP_COVERED_RESULT])
16521649

16531650

1654-
@pytest.mark.skipif('StrictVersion(coverage.__version__) < StrictVersion("4.0")')
16551651
def test_skip_covered_coveragerc_config(testdir):
16561652
testdir.makefile('', coveragerc=SKIP_COVERED_COVERAGERC)
16571653
script = testdir.makepyfile(SKIP_COVERED_TEST)

0 commit comments

Comments
 (0)