This document provides an introduction to unit testing in Python using the nose testing framework and mock library. It discusses:
1) How to install and use nose to find, run tests, and generate reports in one step. Nose can integrate with doctests and unittest.
2) The basics of writing unit tests using assert statements and examples of simple passing and failing tests.
3) How to use the mock library to fake dependencies in tests by mocking objects and specifying return values. This improves test isolation and speed.
4) Best practices for test-driven development including writing quick and focused tests, mocking time-consuming objects, and only running failed tests when issues are encountered. Dependency injection and inversion of