Summary
We have finally covered the most important topic in Python programming: automated testing. Test-driven development is considered a best practice. The standard library unittest
module provides a great out-of-the-box solution for testing, while the pytest
framework has some more Pythonic syntaxes. Mocks can be used to emulate complex classes in our tests. Code coverage gives us an estimate of how much of our code is being run by our tests, but it does not tell us that we have tested the right things.
Thank you for reading Getting Started with Python. I hope you've enjoyed the ride and are eager to start implementing object-oriented software in all your future projects!