django_coverage_plugin: Missing DJANGO_SETTINGS_MODULE
With empty .coveragerc
:
$ coverage run foo/manage.py test bar
[...works...]
With django-coverage-plugin in .coveragerc
:
[run]
plugins =
django_coverage_plugin
$ coverage run foo/manage.py test bar
[...]
django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
manage.py
is unmodified (generated by Django).
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 24 (9 by maintainers)
Commits related to this issue
- Revert django_coverage_plugin to 1.1 due to regression https://github.com/nedbat/django_coverage_plugin/issues/18 — committed to gpodder/mygpo by stefankoegl 8 years ago
- Check settings later, to avoid errors. #18 Some programs don't need settings. If we check early, then our plugin will fail where the original program would not. Now we check later, when we know th... — committed to nedbat/django_coverage_plugin by nedbat 8 years ago
I was getting the following error:
I thought I had the setting enabled, but here’s the thing:
Error is gone 🎉