We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Testing the untestable: a beginner’s guide to mock objects

Formal Metadata

Title
Testing the untestable: a beginner’s guide to mock objects
Title of Series
Part Number
141
Number of Parts
169
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Andrew Burrows - Testing the untestable: a beginner’s guide to mock objects Mock objects can be a powerful tool to write easy, reliable tests for the most difficult to test code. In this session you will learn your way around Python 3’s unittest.mock package starting at the simplest examples and working through progressively more problematic code. You’ll learn about the Mock class, sentinels and patching and how and when to use each of them. You will see the benefits that mocks can bring and learn to avoid the pitfalls. Along the way I’ll fill you in on some of the bewildering terminology surrounding mocks such as “SUT”, “Stub”, “Double”, “Dummy” , “mockist” and more and I’ll give a brief plug for my own mockextras package that can enhance your mock experience.