pytest-dev / pytest-dev/pytest-django

No way to specify the database for fixtures

Open
#1,192 9 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

The only way to declare that a fixture requires a database is the db fixture. However, since #1186 this will only pull in the default database. As far as I can see, there is currently no way to specify a different database.

Prior to #1186, the db fixture pulled in all databases.

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 by tracing the db fixture behavior changed by #1186 and how database selection is currently handled. Identify where a fixture could request a non-default database, then add coverage showing that the requested database is available while existing default-database behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
database, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.