Chapter 4
Creating an Isolated Test Environment with Test Doubles
Section 1
Test Doubles and the unittest.mock Framework
In this video, we go over what test doubles are and how they help you test your production code in isolation. Then we’ll go over how to use the unittest.mock mocking framework and the PyTest monkeypatch TestFixture for easily implementing test doubles in your tests. - Learn what the different types of test doubles are and how they are used to help write unit tests - Learn about the unittest.mock framework and it’s ability to create mock objects - Learn about the monkeypatch utility for replacing existing code with test doubles