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 agentmods add skills/sagar-shirwalkar/servicenow-atlas/python-testing-patternsnpx skills add sagar-shirwalkar/servicenow-atlas --skill python-testing-patternsgit clone --depth 1 https://github.com/sagar-shirwalkar/servicenow-atlasWrote 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/sagar-shirwalkar/servicenow-atlas/python-testing-patterns)<a href="https://agentmods.dev/skills/sagar-shirwalkar/servicenow-atlas/python-testing-patterns"><img src="https://agentmods.dev/badge/skills/sagar-shirwalkar/servicenow-atlas/python-testing-patterns.svg" alt="Measured on agentmods" 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.00044 | $0.00878 |
| Opus 5 | $0.00022 | $0.00439 |
| Sonnet 5 | $0.00009 | $0.00176 |
| Haiku 4.5 | $0.00004 | $0.00088 |
Grade A, and why
python-testing-patterns 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 5d 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 — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
When to use
- Writing unit or integration tests for the project
- Setting up test infrastructure (conftest.py, fixtures)
- Adding tests for a new module
- Debugging a failing test
Prerequisites
Tests require the dev dependencies:
uv sync --extra dev
Test structure
Tests live in tests/ at the project root, mirroring atlas/:
tests/
├── conftest.py # Shared fixtures
├── test_chunk.py # Tests for atlas/chunk.py
├── test_make_bundle.py # Tests for atlas/make_bundle.py
└── test_embed/
├── conftest.py # Embedder fixtures
└── test_onnx.py # Tests for atlas/embed/onnx.py
Fixture patterns
Use conftest.py for shared fixtures. Keep them scoped appropriately.
tests/conftest.py
from __future__ import annotations
from collections.abc import Generator
from pathlib import Path
import tempfile
import pytest
@pytest.fixture
def tmp_bundle_dir() -> Generator[Path, None, None]:
"""Provide a temporary directory for bundle output."""
with tempfile.TemporaryDirectory() as d:
yield Path(d)
Mocking external dependencies
For tests that should not hit Hugging Face or the network:
@pytest.fixture(autouse=True)
def mock_hf_download(monkeypatch: pytest.MonkeyPatch) -> None:
"""Prevent accidental network calls during tests."""
def fake_download(*args, **kwargs) -> str:
return "/tmp/fake-model-dir"
monkeypatch.setattr(
"huggingface_hub.snapshot_download",
fake_download,
)
For tests that need real ONNX inference, mark them as integration:
@pytest.mark.integration
def test_onnx_embedder_inference(onnx_embedder: OnnxEmbedder) -> None:
embeddings = onnx_embedder.embed(["hello world"])
assert embeddings.shape[1] == onnx_embedder.dim
Test patterns by module
atlas/chunk.py
- Unit test
parse_frontmatterwith: valid YAML, malformed YAML, no frontmatter, empty file. - Unit test
_split_on_h2with: normal headings, no headings, consecutive headings, heading at EOF. - Integration test
chunk_fileagainst a real markdown file intests/fixtures/.
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.
- 5d ago First seen · 134 lines · 44 tokens per session scan A 8d674892825f
python-testing-patterns is a skill published in the GitHub repository sagar-shirwalkar/servicenow-atlas (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 878 once invoked, about $0.0002 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-08-31.
Other skills, from other repositories
testing-python-pytest
Generates professional pytest unit test suites for Python source files, ensuring >90% line and branch coverage per file. Analyzes modules with AST inspection to discover all classes, methods, and functions, then produces well-structured tests following the AAA pattern with fixtures, parametrize, mocking, and…
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
testing-python
Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, and async testing.
idapython
IDA Pro Python scripting for reverse engineering. Use when writing IDAPython scripts, analyzing binaries, working with IDA's API for disassembly, decompilation (Hex-Rays), type systems, cross-references, functions, segments, or any IDA database manipulation. Covers ida modules (50+), idautils iterators, and common…
python-playground
Run and test Python code in a dedicated playground directory. Use when you need to execute Python scripts, test code snippets, investigate CPython behavior, or experiment with Python without affecting the main codebase.
review-usability
Check whether the common Python code an LLM would plausibly write still works on this branch, testing real cases in ./playground against CPython. Use to find behaviour that diverges from CPython or trips up ordinary idiomatic code.