Skip to content
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

Add initial experimental multi database support #930

Merged
merged 1 commit into from
May 14, 2021

Conversation

bluetech
Copy link
Member

@bluetech bluetech commented May 8, 2021

This PR adds experimental support for multi-database configurations - refs #924.

Currently, we only add a databases argument to the django_db marker, which corresponds to the databases attribute of Django's TransactionTestCase/TestCase. We probably also want some fixture to be able to control this more nicely for an entire file, module, session etc, but that can be done later.

Since I'm not really sure about the API, I marked it as experimental for now. If it works out fine, we can stabilize it.

@bluetech bluetech force-pushed the multi-db branch 3 times, most recently from 034a5d8 to b25504e Compare May 8, 2021 17:26
@bluetech bluetech merged commit 92c6b7e into pytest-dev:master May 14, 2021
@bluetech bluetech deleted the multi-db branch October 27, 2023 11:42
@julianmoji
Copy link

EY @bluetech, I have a function test that access to a Mongo and Postgres, This is a mix between TransactionalTestCase and TestCase, but it seems to be that the entire test is wrapped in a TransactionalTestCase because the Postgres is flushed too, This should not happen since transaction=False is being specified in the marker

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 this pull request may close these issues.

2 participants