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

YouTube

Stop Using Mocks - for a While

PyCon US via YouTube

Overview

Explore a thought-provoking talk from PyCon US that challenges the conventional use of mocks in testing. Discover why classic testing approaches often fall short in real-world scenarios and learn alternative strategies for designing more maintainable and effective tests. Delve into patterns like "Functional Core, Imperative Shell" and Dependency Injection, and understand how hand-rolled fakes can serve as a superior alternative to mocking and patching. Gain insights on improving code design, creating more robust test suites, and achieving a healthy test pyramid. Through practical examples and a journey from sync APIs to building fake APIs, acquire valuable techniques to enhance your testing practices and overall code quality.

Syllabus

Introduction
The Heros Journey
Example Code
Sync to API
Mocks are Broken
Adapter Example
Build a Fake
Dependency Injection
Wrapping Up
Building a Fake API

Taught by

PyCon US

Reviews

Start your review of Stop Using Mocks - for a While

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.