How to Write Speedy Unit Tests in Django, Part 1

How to Write Speedy Unit Tests in Django, Part 1

Interested in speeding up your application's test suite, or just writing better tests in Python/Django?  My company, Celerity, just published an article I wrote on fast unit testing with Django.  

One of the most important aspects of working on a software team is code testing. During a big sprint towards a production release on a recent project, my team decided to get really serious about testing. After all, we had code in production now. We had to make absolutely sure that future releases fixed bugs instead of introducing them.  We immediately began to focus on beefing up our existing test coverage with thorough tests. But as our coverage increased, something we hadn’t expected started to happen: Our test suite was becoming slow. This was a minor annoyance at first, but then (and even more unexpectedly) it started to become a problem.

In this first part of a two part series, I cover a background on literal unit testing, working with read-only data in memory, and proper test case setup/teardowns.  Look forward to the next post where things get really crazy and we start using Mock to mock everything!

Read the full article hereHow To Write Speedy Unit Tests in Django, Part 1: The Basics

Next entry

Previous entry

comments powered by Disqus

Categories