June 2019
Beginner to intermediate
770 pages
19h 24m
English
For larger applications, each application module can have a parallel module that includes TestCase for that module. This can form two parallel package structures: an src structure with the application module and a test structure with the test modules. Here are two parallel directory trees that show us the collections of modules:
src
__init__.py
__main__.py
module1.py
module2.py
setup.py
tests
__init__.py
module1.py
module2.py
all.py
Clearly, the parallelism isn't exact. We don't usually have an automated unit test for setup.py. A well-designed __main__.py may not require a separate unit test, as it shouldn't have much code in it. We'll look at some ways to design __main__.py in Chapter 18, Coping with ...
Read now
Unlock full access