-
Notifications
You must be signed in to change notification settings - Fork 348
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
Running py.test -h
causes exception
#289
Comments
Any progress here? I'm also seeing this exception when I run "py.test --help". |
I cannot reproduce this, can you give some more details?
|
It now works for me, probably fixed by some update. pytest==2.8.2 |
I still get the error. After some more digging it turns out there is something funky with the py.test plugin provided by
|
And perhaps just to clarify, I'm not 100% sure this is an issue with
|
django-assets ships with its own pytest plugin: that includes a single fixture that is marked for autouse: By importing I have not investigated this further, but generally, stuff from within Django must not be imported before before settings and |
I've added a fix for this in 211495b. This error also appeared in pytest-django's own test suite since it has a conftest.py that does Buuut, in the case with django-assets: there is some import magic going on. It may be buggy and give surprising errors by not using Django 1.7+ app loading APIs. |
Great stuff, thanks for this @pelme! |
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
configured. When another plugin(or conftest) imports Django, there might be errors arising. Importing Django before pytest-django has the chance to configure settings and call django.setup() may be an error, but it may also be correct depending on what gets imported. This commit closes pytest-dev#289.
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
This needs pytest-django > 2.9.1 https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst#291 See pytest-dev/pytest-django#289 Specially comments: pytest-dev/pytest-django#289 (comment)
configured. When another plugin(or conftest) imports Django, there might be errors arising. Importing Django before pytest-django has the chance to configure settings and call django.setup() may be an error, but it may also be correct depending on what gets imported. This commit closes pytest-dev#289.
Running
py.test -h
causes the following exception:Running py.test on its own executes Django tests as expected.
OS X 10.11.1
Python 2.7.10 from Homebrew
pytest==2.8.1
pytest-django==2.9.1
The text was updated successfully, but these errors were encountered: