The Python warnings
module handles a special subclass of exceptions. We can use the warnings
module to identify potential problems in our application. The warnings module is used internally to track a number of internal considerations.
The warning concept fits into the middle ground between perfectly normal operations and erroneous conditions. Our program may not be performing optimally, but it's not completely broken, either.
There are three notable warning classes that we might encounter when running unit tests. Since the unit test framework displays all
warnings, we may see some warnings in a test context that we don't see in the normal operational use of our software.