Skip to content

Commit 3d6be2b

Browse files
committed
fix: json format should bump for regions
1 parent a9992d2 commit 3d6be2b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

coverage/jsonreport.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
# "Version 1" had no format number at all.
2626
# 2: add the meta.format field.
27-
FORMAT_VERSION = 2
27+
# 3: add region information (functions, classes)
28+
FORMAT_VERSION = 3
2829

2930
class JsonReporter:
3031
"""A reporter for writing JSON coverage results."""

tests/test_json.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_branch_coverage(self) -> None:
9898
expected_result = {
9999
'meta': {
100100
"branch_coverage": True,
101-
"format": 2,
101+
"format": 3,
102102
"show_contexts": False,
103103
},
104104
'files': {
@@ -150,7 +150,7 @@ def test_simple_line_coverage(self) -> None:
150150
expected_result = {
151151
'meta': {
152152
"branch_coverage": False,
153-
"format": 2,
153+
"format": 3,
154154
"show_contexts": False,
155155
},
156156
'files': {
@@ -184,7 +184,7 @@ def test_regions_coverage(self) -> None:
184184
expected_result = {
185185
"meta": {
186186
"branch_coverage": False,
187-
"format": 2,
187+
"format": 3,
188188
"show_contexts": False,
189189
},
190190
"files": {
@@ -407,7 +407,7 @@ def test_branch_regions_coverage(self) -> None:
407407
},
408408
"meta": {
409409
"branch_coverage": True,
410-
"format": 2,
410+
"format": 3,
411411
"show_contexts": False,
412412
},
413413
"totals": {
@@ -441,7 +441,7 @@ def run_context_test(self, relative_files: bool) -> None:
441441
expected_result = {
442442
'meta': {
443443
"branch_coverage": False,
444-
"format": 2,
444+
"format": 3,
445445
"show_contexts": True,
446446
},
447447
'files': {

0 commit comments

Comments
 (0)