1# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
3
4# Settings to use when using coverage.py to measure itself, known as
5# meta-coverage.  This gets intricate because we need to keep the coverage
6# measurement happening in the tests separate from our own coverage measurement
7# of coverage.py itself.
8
9[run]
10branch = true
11data_file = ${COVERAGE_METAFILE?}
12parallel = true
13source =
14    ${COVERAGE_HOME-.}/coverage
15    ${COVERAGE_HOME-.}/tests
16# $set_env.py: COVERAGE_CONTEXT - Set to 'test_function' for who-tests-what
17dynamic_context = ${COVERAGE_CONTEXT-none}
18
19[report]
20# We set a different pragmas so our code won't be confused with test code, and
21# we use different pragmas for different reasons that the lines won't be
22# measured.
23exclude_lines =
24    pragma: not covered
25
26    # Lines in test code that aren't covered: we are nested inside ourselves.
27    # Sometimes this is used as a comment:
28    #
29    #       cov.start()
30    #       blah()              # pragma: nested
31    #       cov.stop()          # pragma: nested
32    #
33    # In order to exclude a series of lines, sometimes it's used as a constant
34    # condition, which might be too cute:
35    #
36    #       cov.start()
37    #       if "pragma: nested":
38    #           blah()
39    #           cov.stop()
40    #
41    pragma: nested
42
43    # Lines that are only executed when we are debugging coverage.py.
44    def __repr__
45    pragma: debugging
46
47    # Lines that are only executed when we are not testing coverage.py.
48    pragma: not testing
49
50    # Lines that we can't run during metacov.
51    pragma: no metacov
52
53    # These lines only happen if tests fail.
54    raise AssertionError
55    pragma: only failure
56
57    # OS error conditions that we can't (or don't care to) replicate.
58    pragma: cant happen
59
60    # Obscure bugs in specific versions of interpreters, and so probably no
61    # longer tested.
62    pragma: obscure
63
64    # Jython needs special care.
65    pragma: only jython
66    skip.*Jython
67
68    # IronPython isn't included in metacoverage.
69    pragma: only ironpython
70
71partial_branches =
72    pragma: part covered
73    pragma: if failure
74    pragma: part started
75    if env.TESTING:
76    if .* env.JYTHON
77    if .* env.IRONPYTHON
78
79ignore_errors = true
80precision = 1
81
82[paths]
83source =
84    .
85    *\coverage\trunk
86    */coverage/trunk
87    *\coveragepy
88    /io
89