Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Django now has fast tests. Changeset 9756 switched Django’s TestCase class to running tests inside a transaction and rolling back at the end (instead of doing a full dump and reload). “Ellington’s test suite, which was taking around 1.5-2 hours to run on Postgres, has been reduced to 10 minutes.”

Tagged , , , , , ,

3 comments

  1. Always glad to see our good ideas being adopted by other projects :). But it's kinda sad that there's no mention of the heritage of the idea in the ticket, commit log or announcement.

    The mailing list post clearly says where the idea came from... Is rails a banned word in the django project? :)

    Koz - 16th January 2009 21:54 - #

  2. I don't think it's completely clear cut that this idea originated with Rails - as Russ Magee says further down the e-mail thread that wasn't the first time the idea had been suggested within the context of Django. I've certainly seen tests run in transactions in other projects (the Guardian's J2EE apps use this trick for example).

    Simon Willison - 16th January 2009 23:23 - #

  3. Awesome, this makes using large numbers of unit tests a lot less painful.

    Jason Davies - 18th January 2009 00:38 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site