Skip to content

Commit

Permalink
fix: json format should bump for regions
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jul 11, 2024
1 parent a9992d2 commit 3d6be2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion coverage/jsonreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

# "Version 1" had no format number at all.
# 2: add the meta.format field.
FORMAT_VERSION = 2
# 3: add region information (functions, classes)
FORMAT_VERSION = 3

class JsonReporter:
"""A reporter for writing JSON coverage results."""
Expand Down
10 changes: 5 additions & 5 deletions tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_branch_coverage(self) -> None:
expected_result = {
'meta': {
"branch_coverage": True,
"format": 2,
"format": 3,
"show_contexts": False,
},
'files': {
Expand Down Expand Up @@ -150,7 +150,7 @@ def test_simple_line_coverage(self) -> None:
expected_result = {
'meta': {
"branch_coverage": False,
"format": 2,
"format": 3,
"show_contexts": False,
},
'files': {
Expand Down Expand Up @@ -184,7 +184,7 @@ def test_regions_coverage(self) -> None:
expected_result = {
"meta": {
"branch_coverage": False,
"format": 2,
"format": 3,
"show_contexts": False,
},
"files": {
Expand Down Expand Up @@ -407,7 +407,7 @@ def test_branch_regions_coverage(self) -> None:
},
"meta": {
"branch_coverage": True,
"format": 2,
"format": 3,
"show_contexts": False,
},
"totals": {
Expand Down Expand Up @@ -441,7 +441,7 @@ def run_context_test(self, relative_files: bool) -> None:
expected_result = {
'meta': {
"branch_coverage": False,
"format": 2,
"format": 3,
"show_contexts": True,
},
'files': {
Expand Down

0 comments on commit 3d6be2b

Please sign in to comment.