Install any skill in seconds. Free to start, no credit card required.
Get Started Free →hashgraph-online/python-mock-isolation-design
Use Python mocks and fakes as a design tool without losing behavioral confidence.
Passed 20 of 22 test cases with the skill, and 19 of 22 without it.
and 1 more in the full report
2 fixed18 passed either way1 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
We are building a Python notification dispatcher that sends emails and Slack messages. Our test suite is extremely brittle because almost every collaborator is replaced with unconfigured mocks. Please review our strategy for test isolation, give guidance on choosing between stateful fakes and module-level patches, and outline how we should structure behavior assertions versus interaction checks.
| Checked | Without skill | With skill |
|---|---|---|
| recommends patching where the code under test looks up the dependency | Missed | Passed |
| includes a verification section listing the boundary being replaced and why | Missed | Passed |
| specifies recording integration or contract coverage for the real boundary | Missed | Passed |
The instructions your model reads when the skill loads.
Use this skill when replacing a dependency in a Python test changes what the test proves. Mocks are useful at slow, nondeterministic, or external boundaries; they become harmful when they replace the behavior the test is supposed to validate.
Primary source: Harry Percival, Test-Driven Development with Python, 3rd ed. Guidance is transformed and paraphrased from chapters 20, 21, 27, and Appendix A, especially manual monkeypatching, unittest.mock.patch, mock coupling, call argument inspection, test isolation, and the architectural route out of mock-heavy suites.
Name the boundary.
Choose the replacement.
patch when replacing a collaborator looked up by the module under test.Keep behavior assertions primary.
Watch for design feedback.
Read mock-isolation-patterns.md for replacement choices and smell handling.
mock.return_value and side_effect deliberately; do not let default mocks create imaginary object graphs.MagicMock objects without specs for important interfaces.test cases passed, vs 19 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.