Things that cause trouble

Coverage.py works well, and I want it to properly measure any Python program,but there are some situations it can’t cope with. This page details some knownproblems, with possible courses of action, and links to coverage.py bug reportswith more information.

I would love tohear from you if you have information aboutany of these problems, even just to explain to me why you want them to startworking properly.

If your problem isn’t discussed here, you can of course search thecoverage.pybug tracker directly to see if there is some mention of it.

Things that don’t work

There are a number of popular modules, packages, and libraries that preventcoverage.py from working properly:

  • execv, or one of its variants. These end the current program and replaceit with a new one. This doesn’t save the collected coverage data, so yourprogram that calls execv will not be fully measured. A patch for coverage.pyis inissue 43.
  • thread, in the Python standard library, is the low-level threadinginterface. Threads created with this module will not be traced. Use thehigher-levelthreading module instead.
  • sys.settrace is the Python feature that coverage.py uses to see what’shappening in your program. If another part of your program is usingsys.settrace, then it will conflict with coverage.py, and it won’t bemeasured properly.

Things that require –timid

Some packages interfere with coverage measurement, but you might be able tomake it work by using the--timid command-line switch, or the[run]timid=True configuration option.

  • DecoratorTools, or any package which uses it, notablyTurboGears.DecoratorTools fiddles with the trace function. You will need to use--timid.

Still having trouble?

If your problem isn’t mentioned here, and isn’t already reported in thecoverage.py bug tracker, pleaseget in touch with me,we’ll figure out a solution.