Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Dance with Shadows - Stubs, Patch and Mock

EuroPython Conference via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the world of fake objects in this 32-minute conference talk from EuroPython 2022. Dive into key factors for using fake objects, their characteristics, and potential dangers. Learn patching techniques, common mistakes, and scope considerations. Discover inverse dependency as an alternative to patching. Master mock properties, including return values, side effects, and specs, while understanding their use as spy functions and wrappers. Gain insights into asserting on callings and explore specialized mocking libraries like pyvcr and moto for web development.

Syllabus

I present the key factors to use fake objects, and present some dangers.
Discuss some wanted characteristics in this kind of components.
Patching: how to do that and some common mistakes. After that I present patch scopes and some disadvantage in the use of this technique.
Inverse dependency as an possible alternative to patch
Mocks properties: return value, side effect and specs. Using mocks as spy functions or wrappers. Asserting on callings.
Using special libraries for mocking. Presenting pyvcr and moto."

Taught by

EuroPython Conference

Reviews

Start your review of Dance with Shadows - Stubs, Patch and Mock

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.