summaryrefslogtreecommitdiff
path: root/doc/faq.rst
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-05-29 12:54:00 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-05-29 12:54:00 -0400
commit22fe2eb167a18dda8fd3e14cbf9166a1c7331fb9 (patch)
treea51e1dc67ccc1106078260f6698cf4743cd0c4c2 /doc/faq.rst
parentc41e8840131497db54edcaa43931c05bfc973196 (diff)
downloadpython-coveragepy-git-22fe2eb167a18dda8fd3e14cbf9166a1c7331fb9.tar.gz
doc: mention dynamic contexts in more places
Diffstat (limited to 'doc/faq.rst')
-rw-r--r--doc/faq.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/faq.rst b/doc/faq.rst
index 082ccbd1..0fce8903 100644
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -50,6 +50,18 @@ reported. If you collect execution data on Python 3.7, and then run coverage
reports on Python 3.8, there will be a discrepancy.
+Q: Can I find out which tests ran which lines?
+..............................................
+
+Yes! Coverage.py has a feature called :ref:`dynamic_contexts` which can collect
+this information. Add this to your .coveragerc file::
+
+ [run]
+ dynamic_context = test_function
+
+and then use the ``--contexts`` option when generating an HTML report.
+
+
Q: How is the total percentage calculated?
..........................................