#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: Normal | Keywords: Triage Stage: Accepted | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | ------------------------------------------------+------------------------ Inspired by https://gist.github.com/zenweasel/7495758 and https://www.caktusgroup.com/blog/2013/10/02/skipping-test-db-creation/, `DiscoverRunner` could skip creating the test database if no `TransactionTestCase` or its subclasses are used.
I'd suggest adding an attribute on the test classes such as `_needs_database` rather than using `isinstance(test, TransactionTestCase)` in those patches. This would allow compatibility in case Django users have other classes using the database that don't inherit from Django's classes (though I'm not aware of anyone doing this). -- Ticket URL: <https://code.djangoproject.com/ticket/28478> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.7ad6bd6bb2fdfa2f907bcd9638511c5c%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.