summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-06-30 12:32:17 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-06-30 12:40:44 -0400
commit201f5e93cde09c1fe613e33e0529cf0390cdb09c (patch)
tree9d875f6a142d3b3baa81b7284fee4fcdfec0a0e0
parent612d6600e5381527e028a8541c477ad6e8a3bb65 (diff)
downloadpython-coveragepy-git-201f5e93cde09c1fe613e33e0529cf0390cdb09c.tar.gz
Make show_contexts available to set_option, and document it.
-rw-r--r--coverage/config.py3
-rw-r--r--doc/config.rst4
2 files changed, 6 insertions, 1 deletions
diff --git a/coverage/config.py b/coverage/config.py
index f8c91897..01ceef79 100644
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -202,12 +202,12 @@ class CoverageConfig(object):
self.precision = 0
self.show_missing = False
self.skip_covered = False
- self.show_contexts = False
# Defaults for [html]
self.extra_css = None
self.html_dir = "htmlcov"
self.html_title = "Coverage report"
+ self.show_contexts = False
# Defaults for [xml]
self.xml_output = "coverage.xml"
@@ -355,6 +355,7 @@ class CoverageConfig(object):
('extra_css', 'html:extra_css'),
('html_dir', 'html:directory'),
('html_title', 'html:title'),
+ ('show_contexts', 'html:show_contexts', 'boolean'),
# [xml]
('xml_output', 'xml:output'),
diff --git a/doc/config.rst b/doc/config.rst
index dfff813a..04daa01d 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -275,6 +275,10 @@ also apply to HTML output, where appropriate.
``directory`` (string, default "htmlcov"): where to write the HTML report
files.
+``show_contexts`` (boolean): should the HTML report include an indication on
+each line of which contexts executed the line. See :ref:`dynamic_contexts` for
+details.
+
``extra_css`` (string): the path to a file of CSS to apply to the HTML report.
The file will be copied into the HTML output directory. Don't name it
"style.css". This CSS is in addition to the CSS normally used, though you can