diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-24 06:46:08 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-24 06:46:08 -0400 |
| commit | b5d5aa99ebcfa140bc779301b22a0866903b6342 (patch) | |
| tree | c4c267522b08ac931379975797c73f0e7ae1d6fe /doc | |
| parent | 7b0badf176832c11ec6a08c124985638c6a13407 (diff) | |
| download | python-coveragepy-git-b5d5aa99ebcfa140bc779301b22a0866903b6342.tar.gz | |
Minimal docs for dynamic contexts
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/contexts.rst | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/doc/contexts.rst b/doc/contexts.rst index c1d4a173..1f1ce763 100644 --- a/doc/contexts.rst +++ b/doc/contexts.rst @@ -16,9 +16,8 @@ in which it was run. This can provide more information to help you understand the behavior of your tests. There are two kinds of context: static and dynamic. Static contexts are fixed -for an entire run, and are set explicitly with an option. - -Dynamic contexts are coming soon. +for an entire run, and are set explicitly with an option. Dynamic contexts +change over the course of a single run. Static contexts @@ -39,7 +38,18 @@ A static context is specified with the ``--context=CONTEXT`` option to Dynamic contexts ---------------- -Not implemented yet. +Dynamic contexts are found during execution. There is currently support for +one kind: test function names. Set the ``dynamic_context`` option to +``test_function`` in the configuration file:: + + [run] + dynamic_context = test_function + +Each test function you run will be considered a separate dynamic context, and +coverage data will be segregated for each. A test function is any function +whose names starts with "test". + +Ideas are welcome for other dynamic contexts that would be useful. Context reporting |
