#28478: Make DiscoverRunner skip creating a test database if not needed
--------------------------------------+------------------------------------
     Reporter:  Tim Graham            |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Testing framework     |                  Version:  master
     Severity:  Release blocker       |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Simon Charette):

 * needs_better_patch:  0 => 1
 * has_patch:  0 => 1


Comment:

 Some tests were failing because the patch wasn't mocking all connection
 interaction attempts. If test database creation is skipped then any
 attempts to connect to it will necessarily fail.

 The current patch prevents that from happening by mocking the `connect`
 method but it unveiled a few `SimpleTestCase` that happened to silently
 interact with the database.

 The only part missing at this point is to decide whether or not we want to
 make `skipUnlessDBFeature` and friends usage on `SimpleTestCase` without
 `databases` override error out or go through a deprecation period where it
 automatically adds `DEFAULT_CONNECTION_ALIAS` to databases and raise a
 warning instead. Given the use case is quite nice I think error'ing out
 should be fine but given we had some instances of this pattern in the test
 suite I thought it was still worth discussing.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28478#comment:16>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.80c435a9eaeea2ceb6f8e4426c3d999f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to