Skip to content

No way to specify the database for fixtures #1192

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

Open
xi opened this issue Apr 14, 2025 · 2 comments · May be fixed by #1193
Open

No way to specify the database for fixtures #1192

xi opened this issue Apr 14, 2025 · 2 comments · May be fixed by #1193

Comments

@xi
Copy link

xi commented Apr 14, 2025

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.

xi added a commit to xi/pytest-django that referenced this issue Apr 14, 2025
xi added a commit to xi/pytest-django that referenced this issue Apr 14, 2025
@bluetech
Copy link
Member

@xi
Copy link
Author

xi commented Apr 15, 2025

@pytest.mark.django_db cannot be used for fixtures, so it does not apply here. The only way to declare that a fixture requires a database is the db fixture, and that does not take any parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants