September 2019
Beginner to intermediate
494 pages
13h
English
In this section, we will be using examples from the Chapter06/Testing subfolder in this book's code repository. Go ahead and import the folder into PyCharm as a project, or create a new project and enter the code as we move along with our discussions.
First and foremost, unit testing in Python is supported by the unittest module, which offers similar functionalities to those in common unit testing frameworks in other programming languages. Generally, tests for a specific unit component of a program are organized into a subclass of the TestCase class from the module.
As an example, consider the test_example.py file in this book's repository, which contains the following code:
from unittest import TestCaseclass MathTest(TestCase): ...
Read now
Unlock full access