Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add fabioc-aloha/Alex_Skill_Mall --skill python-mock-patching-locationgit clone --depth 1 https://github.com/fabioc-aloha/Alex_Skill_MallWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/python-mock-patching-location)<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/python-mock-patching-location"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/python-mock-patching-location/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/python-mock-patching-location"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/python-mock-patching-location.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00020 | $0.00585 |
| Opus 5 | $0.00010 | $0.00293 |
| Sonnet 5 | $0.00004 | $0.00117 |
| Haiku 4.5 | $0.00002 | $0.00059 |
Grade A, and why
python-mock-patching-location scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Mock Patching Location
Category: Testing Time Saved: 30+ minutes debugging "mock not working" Battle-tested: Yes — ChessCoach, multiple Python projects
The Problem
You're writing a test that needs to mock get_client() from module_a. You patch module_a.get_client. The mock doesn't work — the real function still runs.
Why It Happens
Python's import system creates a reference to the function in the importing module. When module_b does from module_a import get_client, it creates module_b.get_client as a separate reference. Patching the original doesn't affect the copy.
The Rule
Patch where the function is USED, not where it's DEFINED
# module_a.py defines get_client()
# module_b.py imports and calls it
# ❌ WRONG — patches the definition, not the usage
@patch('module_a.get_client')
def test_something(mock_client):
result = module_b.do_work() # Still calls real get_client!
# ✅ CORRECT — patches where it's called
@patch('module_b.get_client')
def test_something(mock_client):
result = module_b.do_work() # Uses mock
Decision Table
| Import Style in Target Module | Patch Target |
|---|---|
from module_a import func |
target_module.func |
import module_a then module_a.func() |
module_a.func |
from module_a import func as alias |
target_module.alias |
Async Context Manager Trap
MagicMock doesn't support async with by default:
# ❌ FAILS — MagicMock can't handle async context manager
mock_lock = MagicMock()
async with mock_lock: # TypeError
# ✅ WORKS — proper async mock
class MockAsyncLock:
async def __aenter__(self):
return self
async def __aexit__(self, *args):
pass
mock_lock = MockAsyncLock()
Verification
Test passes AND you've confirmed the mock was actually called:
@patch('module_b.get_client')
def test_something(mock_client):
mock_client.return_value = fake_response
result = module_b.do_work()
mock_client.assert_called_once() # Verify mock was hit
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 87 lines · 20 tokens per session scan A 1d92bfc54b11
python-mock-patching-location is a skill published in the GitHub repository fabioc-aloha/Alex_Skill_Mall (4 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 585 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
flutter-bloc-state-management
Implement BLoC/Cubit state, events, transitions, and async concurrency in Flutter. Use for BLoC/Cubit feature logic, debounced/cancellable events, state rendering, or bloc tests—not generic widget-only work.
unit-test
A Go testing workflow for writing unit tests: small tests that check individual functions or components. It supports table-driven cases, where many inputs and expected results are organised in one test, and subtests.
fuzzing-test
A Go testing guide for generating fuzz tests, which repeatedly try varied inputs to find crashes and unexpected behavior. It first checks whether the code is suitable for fuzzing.
test-component
Write React Testing Library tests for an existing component, following the project's RTL conventions (prefer role/label queries, mock at network boundary, no act()). Invoke when the user asks to test, add tests for, or cover a component.
adept-writing-tests
How to write tests in the adept Go codebase — table-driven tests with testify, golden fixtures under testdata/, the cmd/adept e2e harness, temp-dir/HOME isolation, and coverage gates. Apply when adding or changing Go tests here. (matches: /test.go).
qt-qml-test-run
Builds and runs Qt Quick Test (qmltestrunner / CTest) for a QML project, then writes a Markdown report. Use for "run qml tests", "run qmltestrunner".