[TIP] Problems getting coverage of a TurboGears application
Ned Batchelder
ned at nedbatchelder.com
Thu Mar 17 06:41:52 PDT 2011
This is almost exactly the case the --timid flag was designed for. For
running under nose, make sure you have coverage.py >= 3.3, and create a
.coveragerc file:
[run]
timid = True
It will go slower, but it should measure properly.
--Ned.
On 3/17/2011 7:05 AM, Christoph Zwerschke wrote:
> 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
> http://bugs.python.org/issue1569356
> - Update to TurboGears 1.1.2 and the latest PEAK-Rules
>
> -- Christoph
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
More information about the testing-in-python
mailing list