[TIP] After upgrade to coverage 3.0.1, nosetests --with-coverage shows zero lines covered!

Ned Batchelder ned at nedbatchelder.com
Thu Jul 16 16:34:01 PDT 2009


OK, I'm able to reproduce the problem with these instructions.  I'll dig 
into what's going on here.  First suspect is some very tricky code to 
make decorators work on 2.3, which uses the settrace function to poke 
values into frames.

--Ned.

Doug Latornell wrote:
> Thanks for the suggestions, Ned.  I confirmed that the problem exists 
> in a minimal TG 1.0.5 project:
>
> alec:coverage-test$ tg-admin quickstart spam
> ...
> alec:coverage-test$ cd spam/
> alec:spam$ nosetests --with-coverage --cover-package=spam --cover-erase
> ..
> Name               Stmts   Exec  Cover   Missing
> ------------------------------------------------
> spam                   1      1   100%
> spam.config            1      1   100%
> spam.controllers       7      0     0%   1-13
> spam.templates         1      1   100%
> ------------------------------------------------
> TOTAL                 10      3    30%
> ----------------------------------------------------------------------
> Ran 2 tests in 1.492s
>
> OK
> alec:spam$ sudo easy_install "coverage==2.85"
> ...
> alec:spam$ nosetests --with-coverage --cover-package=spam --cover-erase
> ..
> Name               Stmts   Exec  Cover   Missing
> ------------------------------------------------
> spam                   0      0   100%
> spam.config            0      0   100%
> spam.controllers       7      7   100%
> spam.templates         0      0   100%
> ------------------------------------------------
> TOTAL                  7      7   100%
> ----------------------------------------------------------------------
> Ran 2 tests in 9.206s
>
> OK
>
> Next, I'll try your -L option suggestion, and the logging from tip.
>
> Re: -L is there a way to pass a switch to coverage through the nose 
> plug-in?  AFAIK, the TG quickstart project template relies on nose for 
> test discovery.  The test module has nothing like a unittest.main() 
> interface.
>
> Doug
>
>
> On Wed, Jul 15, 2009 at 6:34 PM, Ned Batchelder <ned at nedbatchelder.com 
> <mailto:ned at nedbatchelder.com>> wrote:
>
>     Doug, thanks for reporting this.  If you don't get a toy TG
>     project working, here are two things to try:
>
>  
> ...
>  
>
>
>     --Ned.
>     http://nedbatchelder.com
>
>

-- 
Ned Batchelder, http://nedbatchelder.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20090716/7358b57c/attachment.htm 


More information about the testing-in-python mailing list