pytest Test Framework

pytest Test Framework is a skill for Claude Code, Codex from FortiumPartners/ensemble. It costs 21 tokens per session (378 once invoked), scanned A, original, MIT.

A toolkit for creating and running pytest tests in Python. Pytest is a popular Python testing framework; the toolkit supports reusable test fixtures, repeated test cases, and replacing parts of a program during tests.

In plain words
What is it for?
Use it to generate unit-test files, run selected pytest files, test error cases such as division by zero, and inspect failure details.
Why use it?
It removes repetitive setup when adding tests and gives structured results showing which tests passed, failed, and where failures occurred.

Skill for Claude CodeCodex

Part of the ensemble-codex plugin — 40 skills shipped together

Install

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.

agentmods
npx agentmods add skills/fortiumpartners/ensemble/pytest
Any agent
npx skills add FortiumPartners/ensemble --skill pytest
Clone the repo
git clone --depth 1 https://github.com/FortiumPartners/ensemble

Made for: Claude Code, Codex.

Or install ensemble-codex, the plugin that ships this one along with the rest of its 40 skills.

Wrote 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.

agentmods badge for pytest Test Framework

README.md
[![agentmods](https://agentmods.dev/badge/skills/fortiumpartners/ensemble/pytest.svg)](https://agentmods.dev/skills/fortiumpartners/ensemble/pytest)
Your own site
<a href="https://agentmods.dev/skills/fortiumpartners/ensemble/pytest"><img src="https://agentmods.dev/badge/skills/fortiumpartners/ensemble/pytest.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 378 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.00378
Opus 5 $0.00010 $0.00189
Sonnet 5 $0.00004 $0.00076
Haiku 4.5 $0.00002 $0.00038

Measured 4d ago against content hash 41eff7780db9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pytest Test Framework 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 4d 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.

packages/codex/.codex/skills/pytest/SKILL.md · 76 lines

What it actually says

pytest Test Framework

Purpose

Provide pytest test execution and generation for Python projects, supporting:

  • Test file generation from templates
  • Test execution with structured output
  • Fixtures and parametrized tests
  • Mock and monkeypatch support

Usage

Generate Test File

python generate-test.py \
  --source src/calculator.py \
  --output tests/test_calculator.py \
  --type unit \
  --description "Calculator fails to handle division by zero"

Execute Tests

python run-test.py \
  --file tests/test_calculator.py \
  --config pytest.ini

Output Format

Test Generation

{
  "success": true,
  "testFile": "tests/test_calculator.py",
  "testCount": 3,
  "template": "unit-test"
}

Test Execution

{
  "success": false,
  "passed": 2,
  "failed": 1,
  "total": 3,
  "duration": 0.234,
  "failures": [
    {
      "test": "test_divide_by_zero",
      "error": "AssertionError: Expected ZeroDivisionError",
      "file": "tests/test_calculator.py",
      "line": 15
    }
  ]
}

Integration

Used by deep-debugger for Python project testing:

  1. Invoke test-detector to identify pytest
  2. Invoke generate-test.py to create failing test
  3. Invoke run-test.py to validate test fails
  4. Re-run after fix to verify passing
Changes

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.

  1. 4d ago First seen · 76 lines · 21 tokens per session scan A 41eff7780db9

Subscribe to this mod's changes

pytest Test Framework is a skill published in the GitHub repository FortiumPartners/ensemble (11 stars, last pushed 1mo ago), licensed MIT. It adds 21 tokens to every session and 378 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-08-30.

Related

Other skills, from other repositories

pest-testing

Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to…

coollabsio/coolify · 171 tokens

test-writer

Generate comprehensive Vitest tests for code examples in JavaScript concept documentation pages, following project conventions and referencing source lines.

leonardomso/33-js-concepts · 26 tokens

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.

pydantic/monty · 52 tokens

pytest-asyncio-httpx-mocking

When masking httpx.AsyncClient with unittest.mock in Pytest, AsyncMock must be used instead of MagicMock for async methods like post/get to prevent TypeError when awaited.

Project-N-E-K-O/N.E.K.O · 44 tokens

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…

google/adk-python · 149 tokens

completion-rule

大模型代码生成任务的自动自检与纠错规则。 在代码输出后强制执行功能自测、单元测试设计和 Linter 检查。 未通过则自动修正并循环,直到全部通过或达到最大迭代次数。 适用于大模型生成或修改代码且要求正确、可测试、规范的场景。 支持 Python、TypeScript、Go、Java,语言规则通过 references 加载。.

Rain120/qq-music-api · 98 tokens