Units Need Testing Too
log in to bookmark this presentaton
Abstract
Python has a wonderful legacy in testing: PyUnit has been in the standard library since March, 2001, and it was already a year old by then. We adopted browser driving quickly, and we do it at huge scale with great test parallelization infrastructure.
Big tests aren't everything, though. In the Python world, true unit tests are somewhat rare, and even most tests written with the unittest library are integration tests. These tests are slow to execute and don't localize failure as well as smaller, focused tests. They leave us with two options: either run them rarely, sacrificing feedback, or run them often, sacrificing speed.
Writing true unit tests removes that particular trade-off. When your tests execute in a millisecond each, you can afford to run a thousand of them every time you save a source file. This talk will discuss what unit tests really are, why they matter, and how to write them in Python.