Changes between Initial Version and Version 1 of Ticket #33277


Ignore:
Timestamp:
Nov 10, 2021, 12:00:40 PM (3 years ago)
Author:
Daniel Hahler
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33277 – Description

    initial v1  
    6969Given that the test DB names are not prefixed with {{{test_}}} with {{{SimpleTestCase}}} you might accidentally change the production DB from within your tests when something like a {{{ThreadPoolExecutor}}} is being used when mixing sync with async etc.
    7070
     71Note: pytest-django monkeypatches {{{django.db.backends.base.base.BaseDatabaseWrapper.ensure_connection}}} to block DB access, which appears to work better in this regard (across threads).
     72
    71731: https://github.com/django/django/blob/dfa1145a22042dcf9e504a5a7edd5557e3e0d07c/django/utils/connection.py#L41
    72742: https://github.com/django/django/blob/dfa1145a22042dcf9e504a5a7edd5557e3e0d07c/django/test/testcases.py#L183
Back to Top