OLD | NEW |
| (Empty) |
1 .. _trouble: | |
2 | |
3 ========================= | |
4 Things that cause trouble | |
5 ========================= | |
6 | |
7 :history: 20121231T085200, brand new docs. | |
8 | |
9 Coverage works well, and I want it to properly measure any Python program, but | |
10 there are some situations it can't cope with. This page details some known | |
11 problems, with possible courses of action, and links to coverage.py bug reports | |
12 with more information. | |
13 | |
14 I would love to :ref:`hear from you <contact>` if you have information about any
of | |
15 these problems, even just to explain to me why you want them to start working | |
16 properly. | |
17 | |
18 If your problem isn't discussed here, you can of course search the `coverage.py | |
19 bug tracker`_ directly to see if there is some mention of it. | |
20 | |
21 .. _coverage.py bug tracker: https://bitbucket.org/ned/coveragepy/issues?status=
new&status=open | |
22 | |
23 | |
24 Things that don't work | |
25 ---------------------- | |
26 | |
27 There are a number of popular modules, packages, and libraries that prevent | |
28 coverage.py from working properly: | |
29 | |
30 * `execv`_, or one of its variants. These end the current program and replace | |
31 it with a new one. This doesn't save the collected coverage data, so your | |
32 program that calls execv will not be fully measured. A patch for coverage.py | |
33 is in `issue 43`_. | |
34 | |
35 * `multiprocessing`_ launches processes to provide parallelism. These | |
36 processes don't get measured by coverage.py. Some possible fixes are | |
37 discussed or linked to in `issue 117`_. | |
38 | |
39 * `gevent`_, which is based on `greenlet`_, and is similar to `eventlet`_. All | |
40 of these manipulate the C stack, and therefore confuse coverage.py. | |
41 `Issue 149`_ has some pointers to more information. | |
42 | |
43 * `sys.settrace`_ is the Python feature that coverage.py uses to see what's | |
44 happening in your program. If another part of your program is using | |
45 sys.settrace, then it will conflict with coverage.py, and it won't be | |
46 measured properly. | |
47 | |
48 .. _execv: http://docs.python.org/library/os#os.execl | |
49 .. _multiprocessing: http://docs.python.org/library/multiprocessing.html | |
50 .. _gevent: http://www.gevent.org/ | |
51 .. _greenlet: http://greenlet.readthedocs.org/ | |
52 .. _eventlet: http://eventlet.net/ | |
53 .. _sys.settrace: docs.python.org/library/sys.html#sys.settrace | |
54 .. _issue 43: https://bitbucket.org/ned/coveragepy/issue/43/coverage-measurement
-fails-on-code | |
55 .. _issue 117: https://bitbucket.org/ned/coveragepy/issue/117/enable-coverage-me
asurement-of-code-run-by | |
56 .. _issue 149: https://bitbucket.org/ned/coveragepy/issue/149/coverage-gevent-lo
oks-broken | |
57 | |
58 | |
59 Things that require --timid | |
60 --------------------------- | |
61 | |
62 Some packages interfere with coverage measurement, but you might be able to | |
63 make it work by using the ``--timid`` command-line switch, or the ``[run] | |
64 timid=True`` configuration option. | |
65 | |
66 * `DecoratorTools`_, or any package which uses it, notably `TurboGears`_. | |
67 DecoratorTools fiddles with the trace function. You will need to use | |
68 ``--timid``. | |
69 | |
70 .. _DecoratorTools: http://pypi.python.org/pypi/DecoratorTools | |
71 .. _TurboGears: http://turbogears.org/ | |
72 | |
73 | |
74 Really obscure things | |
75 --------------------- | |
76 | |
77 * Python 2.5 had a bug (`1569356`_) that could make your program behave | |
78 differently when being measured with coverage. This is diagnosed in `issue 51
`_. | |
79 | |
80 .. _issue 51: http://bitbucket.org/ned/coveragepy/issue/51/turbogears-15-test-fa
iling-with-coverage | |
81 .. _1569356: http://bugs.python.org/issue1569356 | |
82 | |
83 | |
84 Still having trouble? | |
85 --------------------- | |
86 | |
87 If your problem isn't mentioned here, and isn't already reported in the `coverag
e.py bug tracker`_, | |
88 please :ref:`get in touch with me <contact>`, we'll figure out a solution. | |
OLD | NEW |