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

Don't actually close DB connections during tests #2101

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

bigfootjon
Copy link
Collaborator

@bigfootjon bigfootjon commented Jun 6, 2024

This is effectively a combination of a modernization of 9ae27cb and @adamchainz's minimal repro: #1091 (comment)

Refs: #2090
Closes: #1091
Closes: #1290

I fought with django for some time to try and convince it to use my overridden DB connection just inside these unit tests but it wasn't biting. I opted instead to just modify channels' global django settings

This is effectively a combination of a modernization of django@9ae27cb
and @adamchainz's minimal repro: django#1091 (comment)
@bigfootjon bigfootjon force-pushed the tests-no-close-connections branch from b9331c6 to 2fe5b2b Compare June 6, 2024 03:45
Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should advance this, thanks @bigfootjon.

My only consideration is to make sure we call out the change in the release notes for this.

@bigfootjon bigfootjon merged commit aa91c28 into django:main Jul 10, 2024
6 checks passed
@bigfootjon bigfootjon deleted the tests-no-close-connections branch July 10, 2024 00:32
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.

Failing test when calling django orm code wrapped in database_sync_to_async
2 participants