Skip to content

Commit cff82b6

Browse files
committed
test: skip exclude_also test if coverage < 7.2
1 parent e9317c4 commit cff82b6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_pragma.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""Tests for {# pragma: no cover #} support in Django templates."""
55

66
import coverage
7+
import pytest
78
from django.template.loader import get_template
89

910
from .plugin_test import DjangoPluginTestCase
@@ -116,6 +117,9 @@ def test_custom_exclude_patterns(self):
116117
self.cov.save()
117118
self.assert_analysis([1, 5, 7, 9, 10], missing=[7]) # Expecting 1 missing line
118119

120+
@pytest.mark.skipif(
121+
coverage.version_info < (7, 2), reason="exclude_also requires coverage 7.2+"
122+
)
119123
def test_exclude_also(self):
120124
"""Test that report:exclude_also patterns are picked up."""
121125
self.make_template("""\
@@ -132,7 +136,7 @@ def test_exclude_also(self):
132136
plugins = django_coverage_plugin
133137
[report]
134138
exclude_also = custom-exclude
135-
"""
139+
""",
136140
)
137141
tem = get_template(self.template_file)
138142
self.cov = coverage.Coverage(source=["."])

0 commit comments

Comments
 (0)