The unittest module is the Python standard library's automated testing framework. It provides us with some powerful tools to make testing our code reasonably easy.
unittest is based on these standard unit testing concepts found in many test frameworks:
- Test: A test is a single method that will either finish or raise an exception. Tests generally focus on one unit of code, such as a function, method, or process. A test can either pass, meaning the test was successful; fail, meaning the code failed the test; or error, meaning the test itself encountered a problem
- Test case: A test case is a collection of tests which should be run together and contain similar setup and tear-down requirements, typically corresponding to ...