May 2021
Intermediate to advanced
142 pages
3h 37m
English
Just like the dinosaurs in Jurassic Park, Python codebases have a habit of breaking out from inside the fenced pens we try to create for them. One particularly vexing problem can be keeping project code organized. As time passes, code starts to live in places it shouldn’t and it can become increasingly difficult to find what files code should live in or where new code should be placed. In this section, we’ll explore a general strategy that uses Python’s built-in unittest module to keep a directory organized.
Many Python codebases contain tests to help verify that they are working correctly. Frequently, these tests are defined in a directory named tests/ at the top level ...