Skip to content

Commit 3e3de7f

Browse files
committed
add django coverage branch check
1 parent dd32d2e commit 3e3de7f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python_files/tests/unittestadapter/test_coverage.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,10 @@ def test_basic_django_coverage(manage_py_file):
9797
assert polls_views_coverage.get("lines_missed") is not None
9898
assert set(polls_views_coverage.get("lines_covered")) == {3, 4, 6}
9999
assert set(polls_views_coverage.get("lines_missed")) == {7}
100+
101+
model_cov = results.get(str(data_path / "polls" / "models.py"))
102+
coverage_version = Version(coverage.__version__)
103+
# only include check for branches if the version is >= 7.7.0
104+
if coverage_version >= Version("7.7.0"):
105+
assert model_cov.get("executed_branches") == 1
106+
assert model_cov.get("total_branches") == 2

0 commit comments

Comments
 (0)