Testing the Untestable - A Beginner’s Guide to Mock Objects
Explore a beginner's guide to mock objects in Python 3 through this 25-minute conference talk from EuroPython 2016. Learn about the unittest.mock package, including the Mock class, sentinels, and patching techniques. Discover how to write easy and reliable tests for challenging code, understand the benefits and potential pitfalls of using mocks, and familiarize yourself with mock-related terminology such as "SUT," "Stub," "Double," and "Dummy." Progress through increasingly complex examples, from simple use cases to more problematic scenarios. Gain insights into different mocking approaches, including "mockist" testing, and learn about the mockextras package for enhanced mock functionality. By the end of this talk, acquire practical skills to effectively implement mock objects in your Python testing workflow.