pytest-dev / pytest-dev/pytest-django

Early "python-paths" setting?

Open
#764 3 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

I know about the pytest-python path plugin, but I'd like much earlier pythonpaths to be setup by pytest-django, so that it can find my early hook (which applies patches before django.setup()).

It looks like a simpler solution, for now, than making the "django.setup()" call configurable in pytest conf. In an early hook (before conftest.py files search and django;setup() loading), uers have all power to customize environment as they please, including replacing django.setup by something else..

Does it sound right that I attempt a PR on a setting like "python_paths_early = your/path/apps your/path/libs"? Or am I missing some aspects of the architecture?

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

No implementation files or tests are named. Start by tracing pytest-django's initialization and hook ordering around conftest.py discovery and django.setup(), then compare the pytest-python-path plugin behavior; done requires an agreed early-path setting with coverage proving paths are available before the early hook runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.