Skip to content

Commit 5757ce8

Browse files
committed
Test config file
1 parent 0ba2052 commit 5757ce8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

coverage/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def from_file(self, filename, our_file):
372372
# [json]
373373
('json_output', 'json:output'),
374374
('json_pretty_print', 'json:pretty_print', 'boolean'),
375-
('show_contexts', 'json:show_contexts', 'boolean'),
375+
('json_show_contexts', 'json:show_contexts', 'boolean'),
376376
]
377377

378378
def _set_attr_from_config_option(self, cp, attr, where, type_=''):

tests/test_config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,17 @@ def test_non_ascii(self):
502502
self.assertEqual(cov.config.exclude_list, ["first", "✘weirdo", "third"])
503503
self.assertEqual(cov.config.html_title, "tabblo & «ταБЬℓσ» # numbers")
504504

505+
def test_json_config(self):
506+
self.make_file(".coveragerc", """\
507+
[json]
508+
pretty_print = True
509+
show_contexts = True
510+
""")
511+
cov = coverage.Coverage()
512+
513+
self.assertEqual(cov.config.json_show_contexts, True)
514+
self.assertEqual(cov.config.json_pretty_print, True)
515+
505516
def test_unreadable_config(self):
506517
# If a config file is explicitly specified, then it is an error for it
507518
# to not be readable.

0 commit comments

Comments
 (0)