Borrowing it
Nothing to install: this file belongs to sagar-shirwalkar/servicenow-atlas. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/sagar-shirwalkar/servicenow-atlas/main/.agents/skills/python-testing-patterns/SKILL.mdgit 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/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/sagar-shirwalkar/servicenow-atlas/python-testing-patterns"><img src="https://agentmods.dev/badge/skills/sagar-shirwalkar/servicenow-atlas/python-testing-patterns.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.00044 | $0.00878 |
| Opus 5.5 | $0.00018 | $0.00351 |
| Sonnet 5.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 1mo 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.
- 1mo 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 4mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 878 once invoked, about $0.0002 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-08-31.
Other skills, from other repositories
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.
python-testing
Guidelines for writing and running tests in the Agent Framework Python codebase. Use this when creating, modifying, or running tests.
adk-verify-snippets
Checks that every Python code block in a Markdown file actually compiles and runs, by extracting each block to a temporary file, executing it in an isolated subprocess, and writing a pass/fail report with per-snippet coverage. Use when the user asks to verify, test, or validate the code samples in a README, a guide…
adk-setup
Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test run. Runs only when explicitly requested, never on its own. Use when asked to set up, bootstrap, or repair a development…
test-generator
Generate pytest test cases for Python functions and classes.
typescript
TypeScript strict mode with eslint and jest.