June 2017
Beginner to intermediate
274 pages
6h 49m
English
The unittest package has a basic but useful built-in test discovery tool. When we run python -m unittest discover, it searches the current directory for Python S, whose names start with the word test. In addition, it recursively performs the same scan on any subdirectories that contain an init.py file. Once it collects the names of all the matching modules, it runs the test just as if we'd specified the modules on the command line ourselves. This can be illustrated using the following code example:

Read now
Unlock full access