Unit Testing in Python — Patching, Mocks and Dependency Injection
How to test the difficult parts of your code
Published in
10 min readJul 9, 2020
Unit Testing in general is trivial with Python and pytest, but a lot of developers get frustrated when they have to patch dependencies away to make code testable. In this article, you will learn how to patch and use mocks. If you want to refresh basics about unit testing in…