pytest-dev / pytest-dev/pytest-django
Add option to not setup Django in pytest_load_initial_conftests already
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
pytest-django sets up Django in pytest_load_initial_conftests already, which requires you to use a pytest plugin yourself if you want to do anything before it, e.g. changing project settings for tests in the environment, before the settings get imported.
Using a pytest plugin has its issues though (https://github.com/pytest-dev/pytest/issues/5190).
To keep it backward compatible I think a new option could be used here, to either defer this to pytest_configure, or skip it completely (but providing a way to call it manually).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the pytest_load_initial_conftests and pytest_configure entry points, along with the linked pytest issue and PR 719. Define how the new option should defer, skip, and manually invoke Django setup while preserving existing behavior; done means the lifecycle is documented and covered by tests for each mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100