-
Notifications
You must be signed in to change notification settings - Fork 340
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
pytest --help
fails in a partially configured app
#1106
Comments
That’s a fun one! Hopefully using |
here's a minimal case: ==> t.py <==
WAT = 1
==> tests/__init__.py <==
==> tests/conftest.py <==
import os
def pytest_configure():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 't')
from django.conf import settings
settings.WAT |
bluetech
added a commit
to bluetech/pytest-django
that referenced
this issue
Jan 29, 2024
bluetech
added a commit
to bluetech/pytest-django
that referenced
this issue
Jan 29, 2024
bluetech
added a commit
that referenced
this issue
Jan 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
having a difficult time narrowing down a minimal example -- the repo involved is https://github.com/getsentry/sentry
I have figured out why it is happening and the stacktrace for it:
basically what's happening is the setup is skipped here:
pytest-django/pytest_django/plugin.py
Lines 300 to 301 in 6cf63b6
normally it sets the thing that's being looked up here:
pytest-django/pytest_django/plugin.py
Line 358 in 6cf63b6
which then fails to lookup here:
pytest-django/pytest_django/plugin.py
Line 238 in 6cf63b6
something about sentry's
tests/conftest.py
initializes enough of django thatpytest-django
takes over. but since the setup has been skipped it fails to set up properly. I suspect that #238 is playing poorly with something.of note this worked before I upgraded
pytest-django
(I was previously on 4.4.0 and upgraded to 4.7.0 to get django 4.x support)will try and narrow down a smaller reproduction...
The text was updated successfully, but these errors were encountered: