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.5 | $0.00008 | $0.00234 |
| Sonnet 5.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 2mo 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.
- 2mo 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 (6 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.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.
python-mock-patching-location compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| python-mock-patching-locationfabioc-aloha/Alex_Skill_Mall | Skill | 6 | yesterday | MIT | A | 20 | Claude Code, Codex |
| flutter-bloc-state-managementHoangNguyen0403/agent-skills-standard | Skill | 598 | today | MIT | A | 52 | Claude Code, Codex |
| apex-terraform-testjonathan-vella/apex-accelerator | Skill | 51 | yesterday | MIT | A | 106 | Claude Code |
| add-endpointMuhammadUsmanGM/claude-code-best-practices | Skill | 118 | 1mo ago | MIT | A | 48 | Claude Code |
| test-componentMuhammadUsmanGM/claude-code-best-practices | Skill | 118 | 1mo ago | MIT | A | 50 | Claude Code |
| create-pytestsMarieLynneBlock/arcanum-artifex | Skill | 5 | 2mo ago | none | A | 23 | Claude Code, Codex |
| csharp-tunitMarieLynneBlock/arcanum-artifex | Skill | 5 | 2mo ago | none | A | 18 | Claude Code, Codex |