-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
--with-coverage starts going after models are already imported #2
Comments
Looks like you fixed this? |
It's only fixed in hudson because we're running everything through bin/coverage, but I'd like to see if there's a better way. |
Fixed in: http://github.com/rozza/django-nose - please pull. |
I can confirm that rozza's branch fixes this, works well, tests pass. |
Tweaked and added in http://github.com/jbalogh/django-nose/commit/29f3092313. Thanks for the patch! Sorry about the long long delay, I've had other projects in my head. |
Just got bitten by this bug as the django-nose version on pypi hasn't been updated. Is a new release planned? |
This was held up by http://github.com/jbalogh/django-nose/issues/19, but it should be ok now. You can run your tests through |
I don't think this is fixed. I tested with a base Django project and got the following results. With django-nose coverage:
With external coverage:
|
I wouldn't be surprised Django imported contrib stuff before getting to the test runner. There's nothing we can do about that. Does this work for your app code? |
We are seeing the same thing for our app code (specifically models.py). Here's an example with an external app: With django-nose coverage:
With external coverage:
|
nose gives the Capture plugin a score of 500 and the Coverage plugin a score of 300, so Capture always runs before Coverage. I think the only way to get this working would be to bump the Coverage plugin to run before Capture so that it goes Coverage => Django Setup => Capture. I don't know if there would be side effects from moving the Coverage plugin. |
That or figure out a way to temporarily disable the effects of the Capture plugin while the Django plugin is running. I haven't really looked at it, but it sure seems like that ought to be possible, without any side-effects outside the Django plugin. |
This has regressed, I've opened ticket #23 and added a fix for testing there. |
Anyone who is coming across this recently, note: If you downloaded django-nose from pypi it has an older version in which #23 was not fixed. Using the source from github will solve your problem |
@evanreiser: the version on pypi should be up to date now. The readme on pypi was lying about the version (my fault) so I thought we had already released this. |
Awesome, thank you |
I have still the problem. (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 http://pako.overflow.pl/trash/cover_index.html How can i fix it? |
@pbylina What version of django-nose do you have? |
Current version from github. |
The version on pypi still doesn't fix this for me, I believe this should be reopened. coverage run manage.py test |
Is this fixed in pypi? I have a fresh install and I'm getting my models.py reported like this |
Still happens in last PyPi version for me. |
@yuriiz , I am running into the same problem. with |
@yuriiz I used python's reload module and it fixed my coverage report. reload('app.models.*') |
I'm still seeing this issue: nose==1.3.6 |
This will happen from time to time as Django changes how apps are loaded. See #180 for the current incarnation. Leaving this old bug closed. |
I'm trying to get the 'external coverage' workaround working... but when I If I do So I assume django-nose (or nose cover plugin) is always overriding the output options for coverage. If I do |
sorry, my problem was due to my project's use of libfaketime's |
Coverage-tracking should start immediately, or else it looks like your models didn't get run at all.
The text was updated successfully, but these errors were encountered: