Daniel Davis

1 video · 1 event · 2015 · 38 min of video

Talk

0:38:34

Intro to Mocking: Why Unit Testing Doesn't Have To Be So Hard

DjangoCon US 2015 · September 21, 2015

Mocking makes unit tests more reliable by replacing uncertain or costly dependencies with controlled test doubles. Daniel Davis explains how Python’s `unittest.mock` can patch functions and methods, set fixed return values, provide sequences with `side_effect`, verify calls and arguments, and raise exceptions on demand. These…

Spoken at