fdt-refactor-mock-to-fake

Installation
SKILL.md

Refactoring Mocks to Fakes

Remove unittest.mock.patch from tests by making source code inject gateway dependencies, then configuring pre-canned fakes in tests.

Use this skill when: A test imports from unittest.mock import patch or uses @patch(...) decorators.

Key principle: Don't stop at the lowest-level matching gateway. Look for a higher-level abstraction that covers ALL the things being mocked together.


Phase 1: Audit Mock Usage

Read the test file. For each patch(...) call, record:

Installs
13
Repository
dagster-io/erk
GitHub Stars
2
First Seen
Mar 19, 2026
fdt-refactor-mock-to-fake — dagster-io/erk