pytest-dev / pytest-dev/pytest-django

Provide Hook for custom django settings configuration

Open
#1,001 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

We use a setup where we do not use djangos "default" initialization but create our own settings via Djangos settings.configure(xxx).
Currently this is not supported via pytest-django but a very minor change could allow such a functionality.

I think all that would be necessary is the possibility to call a callback before Line 351 (https://github.com/pytest-dev/pytest-django/blob/master/pytest_django/plugin.py#L351).

This change should not have any side effect for existing projects and by default the behavior of the library would not be changed at all.

I will provide a suggestion in the next days for a MWE.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pytest_django/plugin.py around line 351, where the issue suggests invoking a callback before Django initialization. Review the existing configuration path and determine how custom settings.configure(...) can be supported without changing default behavior. Done means the hook works for custom settings and existing projects remain unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.