diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-06-14 06:50:25 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-06-14 06:50:25 -0400 |
commit | cb1b65a4ad1b8302304706b1775401d165486d02 (patch) | |
tree | 7c7539e9b9464c2e89aa66b870d7a1074e10d36b | |
parent | 5914ae7eedf654eb1a89d44f71fedce9626530cb (diff) | |
download | python-coveragepy-git-cb1b65a4ad1b8302304706b1775401d165486d02.tar.gz |
Make it easier for me to measure test_function contexts
-rw-r--r-- | igor.py | 5 | ||||
-rw-r--r-- | metacov.ini | 7 |
2 files changed, 7 insertions, 5 deletions
@@ -75,7 +75,7 @@ def should_skip(tracer): """Is there a reason to skip these tests?""" if tracer == "py": # $set_env.py: COVERAGE_NO_PYTRACER - Don't run the tests under the Python tracer. - skipper = os.environ.get("COVERAGE_NO_PYTRACER") + skipper = os.environ.get("COVERAGE_NO_PYTRACER") or os.environ.get("COVERAGE_CONTEXT") else: # $set_env.py: COVERAGE_NO_CTRACER - Don't run the tests under the C tracer. skipper = os.environ.get("COVERAGE_NO_CTRACER") @@ -174,7 +174,8 @@ def do_combine_html(): cov.load() cov.combine() cov.save() - cov.html_report() + show_contexts = bool(os.environ.get('COVERAGE_CONTEXT')) + cov.html_report(show_contexts=show_contexts) cov.xml_report() diff --git a/metacov.ini b/metacov.ini index 3d4b7cf7..d00019f8 100644 --- a/metacov.ini +++ b/metacov.ini @@ -7,9 +7,10 @@ branch = true data_file = ${COVERAGE_METAFILE?} parallel = true source = - ${COVERAGE_HOME?}/coverage - ${COVERAGE_HOME?}/tests -dynamic_context = none + ${COVERAGE_HOME-.}/coverage + ${COVERAGE_HOME-.}/tests +# $set_env.py: COVERAGE_CONTEXT - set to 'test_function' for who-tests-what +dynamic_context = ${COVERAGE_CONTEXT-none} [report] # We set a different pragma so our code won't be confused with test code. |