r9756 contains the changes to make django.test.TestCase use transaction
rollback (where available) instead of database flush/reload for resetting
the database.  This can provide a nice speedup when running large test
suites -- the Django/sqlite buildbot went from around 20 minutes for the
test run to 3, which is pretty cool.  Other backends see even better results
(excepting MySQL/MyISAM which doesn't do transactions and therefore sees no
improvement).

For the most part this change should be invisible, except for the speed
improvement when running tests.  However, if you have tests that need to
actually test the effects of transaction commit or rollback, you will now
need to use a django.test.TransactionTestCase instead of a
django.test.TestCase.  Also, in some cases the change can reveal
previously-unnoticed test case flaws.  For example in some Django tests
assumptions were made that primary key values would be assigned starting at
one, which isn't true for all backends when rollback is used to reset the
test database.  Such problems are usually easily fixed, but a quick fix, if
changing the test case code is not immediately possible, is to just switch
the test to be a TransactionTestCase.

The doc for the changes is here:
http://docs.djangoproject.com/en/dev/topics/testing/#testcase

I don't know of any existing problems with the changes.  If you observe any
please let me know and/or open a ticket.  Though I tried to test as many
backends/platforms as I could I doubt I've covered every possible
combination.

Many people contributed to getting this done:

- Marc Remolt proposed the idea initially and provided a first
implementation.
- Luke Plant made some improvements as the result of initial testing.
- Ramiro Morales helped me track down the last mysterious error introduced
by the change.
- Eric Holscher provided feedback regarding the effect of the change on the
Ellington testsuite (faster and worth the possible test hiccups).
- Russell Keith-Magee provided guidance and feedback from initial proposal
through the end.
- Hopefully there's no one I forgot to list -- if so my apologies.

Thanks to all who have helped!

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to