[TIP] TestFixtures 1.8.0 Released!

Phlip phlip2005 at gmail.com
Fri Jan 14 06:15:35 PST 2011

[ please set  the reply-to to testing-in-python@ !]

> The package is on PyPI and a full list of all the links to docs, issue
> trackers and the like can be found here:
> http://www.simplistix.co.uk/software/python/testfixtures

The number one problem with all the test fixture systems I ever
auditioned for Django models was unbelievable slowness.

Thats' a major bummer for TDD, because you should integrate after
every few edits, and a slow integration derails your flow. On a
project with 500 tests the complete run could be 5 minutes.

Some fixture systems use JSON to represent model values, and they pump
the JSON directly into SQL insert statements.

I was using farmdev's fixture system, and it was incredibly slow. It
also did not use raw SQL. It fully resolved all records into model
objects, and called save() on them.

(The extra round trip thru a model's validations would be nice - if we
were testing validations. That's what explicit tests are for!)

I rewrote the fixture loader, going direct to SQL, and got a major speed boost.

Then I rewrote it again, going directly from XML to our (very simple &
stereotypical) model objects, and called save(). The speed boost
remained. I have no idea what farmdev fixture was doing to slow things

Anyway thanks for the library, but you can see I can't use its fixture
loader; I'm just putting this out here.

But does it do Django models, and are they performant?


More information about the testing-in-python mailing list