[TIP] Problems getting coverage of a TurboGears application

Christoph Zwerschke cito at online.de
Thu Mar 17 04:05:28 PDT 2011

Am 17.03.2011 06:42 schrieb Richard Jones:
 > I have a TurboGears (1.1b3) application which has a bunch of code in a
 > package that implements all the controller stuff.

I wonder why you're still using a beta version of 1.1. 1.1 final and 
1.1.2 bugfix versions are available and should be fully compatible.

 > When I ask nosetests for coverage (--with-coverage) the modules in my
 > package are listed, but they're always listed with 0% coverage.
 > Does anyone have any hints for where I might even start looking to fix
 > this problem?

This has to do with conflicts between PEAK-Rules and coverage caused by 
their use of sys.settrace. Some things you should try:

- Use coverage with the "--timid" option
   or set timid=True in .coveragerc to activate
   this option with the nose coverage plugin
- Use Python >= 2.6 because of
- Update to TurboGears 1.1.2 and the latest PEAK-Rules

-- Christoph

More information about the testing-in-python mailing list