Test runner

2 views
Skip to first unread message

Rozza

unread,
Jun 18, 2010, 10:15:40 AM6/18/10
to Coverage.py Development
Hi all,

Firstly, Ned great work with coverage.py I'm really liking the new
plugin system!

I've got a question about some results I'm seeing, I'm using the
latest from bitbucket and when running a html coverage report, I'm
seeing inside the methods being marked as covered but not the class /
method definitions or the imports. Is this a change to whats
reported or have I misconfigured something? I'm using Django and
Nose.

Ross

Ned Batchelder

unread,
Jun 18, 2010, 10:39:37 AM6/18/10
to coverag...@googlegroups.com, Rozza
It sounds like coverage.py is being started after the module has been
imported instead of before. Is this not the behavior you saw with the
original Nose plugin?

--Ned.

Zooko O'Whielacronx

unread,
Jun 18, 2010, 11:12:48 AM6/18/10
to coverag...@googlegroups.com
If you think about it, class definitions and the like get evaluated at
import time. So the question is whether code coverage tracing was
turned on.

I have some code in my trialcoverage plugin which attempts to make
sure that coverage is turned on during imports of all of the relevant
source code (i.e. all of the code which is part of the package under
test):

http://tahoe-lafs.org/trac/trialcoverage/browser/trunk/trialcoverage/trialcoverage.py?rev=36#L54

Regards,

Zooko

Ross Lawley

unread,
Jun 18, 2010, 12:02:08 PM6/18/10
to coverag...@googlegroups.com

Ah nice, I'll check it out!

Rozza

unread,
Jun 21, 2010, 4:28:52 AM6/21/10
to Coverage.py Development
All sorted!

I'm using django and django-nose for my current project and it wasn't
starting coverage tracking until after the setup of the django
environments. So I made the setup and teardown a plugin itself, so
that coverage can record it - I've done a pull request for the main
branch but if you need it asap its here: http://github.com/rozza/django-nose

Ross
> >http://tahoe-lafs.org/trac/trialcoverage/browser/trunk/trialcoverage/...
>
> > Regards,
>
> > Zooko
Reply all
Reply to author
Forward
0 new messages