-
Notifications
You must be signed in to change notification settings - Fork 348
Make "py.test --help" more friendly if DSM is set, but PYTHONPATH is not #235
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
Comments
I think plugin.py could try to use a autouse session-scoped fixture for setting up django instead of the current pytest_configure hook here https://github.com/pytest-dev/pytest-django/blob/master/pytest_django/plugin.py#L204 . pytest_configure is called before --help is called whereas fixtures are not touched. |
Thanks for looking into this! It's also being called through I've experimented with moving it from there, too - but it appears a session-scoped autouse fixture is too late, in case you import Django models in your project's conftest.py: Django then complains that models/apps are not ready yet. We need to call I've seen that there's Here is the traceback when importing the Django models in the project's
|
With `pytest --version` and `pytest --help` pytest-django should not throw an error (ImportError) in case of invalid DSM settings etc. Fixes pytest-dev#235
With `pytest --version` and `pytest --help` pytest-django should not throw an error (ImportError) in case of invalid DSM settings etc. This removes hooking into `pytest_configure` altogether, and moves the late call do `_setup_django` into the session-scoped autoload fixture instead. Fixes pytest-dev#235
With `pytest --version` and `pytest --help` pytest-django should not throw an error (ImportError) in case of invalid DSM settings etc. This removes hooking into `pytest_configure` altogether, and moves the late call do `_setup_django` into the session-scoped autoload fixture instead. Fixes pytest-dev#235
With `pytest --version` and `pytest --help` pytest-django should not throw an error (ImportError) in case of invalid DSM settings etc. This removes hooking into `pytest_configure` altogether, and moves the late call do `_setup_django` into the session-scoped autoload fixture instead. Fixes pytest-dev#235
With `pytest --version` and `pytest --help` pytest-django should not throw an error (ImportError) in case of invalid DSM settings etc. This removes hooking into `pytest_configure` altogether, and moves the late call do `_setup_django` into the session-scoped autoload fixture instead. Fixes pytest-dev/pytest-django#235
pytest-django might cause
py.test --help
to behave very unfriendly, whenDJANGO_SETTINGS_MODULE is set, but PYTHONPATH is not set correctly. See the traceback below.
It would be nice if it would behave better, especially when
py.test --help
is used.The text was updated successfully, but these errors were encountered: