refac-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:

Mock target (fully qualified) System boundary (tool) What it simulates Return value configured
Related skills
Installs
1
Repository
dagster-io/erk
GitHub Stars
81
First Seen
Mar 15, 2026