improving performance of django tests with yaml-based fixtures
For TestCases that use yaml fixtures, and/or if your app contains initial data fixtures, they'll get loaded and parsed for every test method - yep, you read that right.
You can get a nice performance boost by caching parsed yaml fixtures/memoization.
Edit: Note that this won't kick in for non- file
fixtures, like StringIO
, which django.core.serializers.pyyaml
might use; generating a key for those escapes me.StringIO
works fine - Python does support really curious keys.