When is the best time to start unit testing in your Python project? My answer is before you writing the first line of code of this project. Unit testing is the fundamental of Test-driven development, which specifically improves the quality and design of your project.
In this post, I’m writing about how could you do unit testing in Python with the unittest
module.
Python 2 (starting on version 2.1) and Python 3 now both have unittest
in the standard library. The unittest
module provides the unit testing framework, and it’s based on JUnit
, which is a unit testing framework for Java.