Skip to content

Missing code definition coverage? #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nedbat opened this issue Jun 16, 2011 · 1 comment
Closed

Missing code definition coverage? #136

nedbat opened this issue Jun 16, 2011 · 1 comment
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Jun 16, 2011

Originally reported by Anonymous


I have very strange problem with code coveraging.

Command:

(internetowykantor)iMac-Pawe-Bylina:development pbylina$ python manage.py test alarm.tests --with-coverage --settings=settings_test --cover-package=alarm --cover-html --cover-html-dir=/tmp/cover --cover-erase --with-doctest --cover-tests
nosetests --verbosity 1 alarm.tests --with-coverage --cover-package=alarm --cover-html --cover-html-dir=/tmp/cover --cover-erase --with-doctest --cover-tests

Summary output:
http://pako.overflow.pl/trash/cover_index.html

Cover said that jabber.py is covered only in 54%. HTML output for this module: http://pako.overflow.pl/trash/alarm.jabber.html
Can you explain this? Why code definition is marked as missed?
With modules.py is the same problem, but other modules are ok. What's wrong?


@nedbat
Copy link
Owner Author

nedbat commented Jun 16, 2011

This is covered in the FAQ: You are importing these modules before coverage.py is started, so the code definitions aren't measured, then the code execution is. You need to start coverage earlier in your process.

@nedbat nedbat closed this as completed Jun 16, 2011
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
agronholm added a commit to agronholm/coveragepy that referenced this issue Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant