python-testing

python-testing is a skill for Claude Code, Codex from aps08/fullstack-clean-architecture. It costs 24 tokens per session (717 once invoked), scanned A, original, Apache-2.0.

A set of project-specific guidelines for testing Python backend code with pytest, including asynchronous code that uses asyncio.

In plain words
What is it for?
Use it to create unit tests, API integration tests, test data factories, shared test fixtures, and mocks for repositories or external services.
Why use it?
It gives tests a consistent location, setup, and approach, so writing or debugging tests does not require figuring out the project’s testing rules each time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to create unit tests, API integration tests, test data factories, shared test fixtures, and mocks for repositories or external services.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aps08/fullstack-clean-architecture/python_testing
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.

Any agent
npx skills add aps08/fullstack-clean-architecture --skill python_testing
Clone the repo
git clone --depth 1 https://github.com/aps08/fullstack-clean-architecture

Made for: Claude Code, Codex.

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 python-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/aps08/fullstack-clean-architecture/python_testing/github.svg)](https://agentmods.dev/skills/aps08/fullstack-clean-architecture/python_testing)
Your own site
<a href="https://agentmods.dev/skills/aps08/fullstack-clean-architecture/python_testing"><img src="https://agentmods.dev/badge/skills/aps08/fullstack-clean-architecture/python_testing/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.

agentmods 80×15 button for python-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/aps08/fullstack-clean-architecture/python_testing"><img src="https://agentmods.dev/badge/skills/aps08/fullstack-clean-architecture/python_testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 717 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00024 $0.00717
Opus 5.5 $0.00010 $0.00287
Sonnet 5.5 $0.00005 $0.00143
Haiku 4.5 $0.00002 $0.00072

Measured 1mo ago against content hash 4b6dc1b972e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-testing 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.

.agents/skills/python_testing/SKILL.md · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Testing Skill

Testing Framework & Configuration

  • Use pytest combined with pytest-asyncio for all testing.
  • Auto Mode: The project is configured with asyncio_mode = "auto" in server/pyproject.toml. Because of this, any test function declared with async def is automatically run inside an asyncio event loop.
  • No Decorators Needed: Do not use the @pytest.mark.anyio or @pytest.mark.asyncio decorators on async test functions, as asyncio_mode = "auto" handles this automatically.

Directory Structure

All test files are located under server/tests/ and are organized as follows:

  • tests/unit/: Contains unit tests testing components in isolation. Subdirectories match the application structure (e.g., core, repositories, service, utils).
  • tests/integrations/: Contains end-to-end integration tests that call API endpoints using a test client.
  • tests/mocks/: Contains mock classes for repositories and external integrations (e.g. MockTodoRepository).
  • tests/factories.py: Contains factory methods (like create_user, create_todo) to generate mock data.
  • tests/conftest.py: Contains common fixtures and configuration for all tests.

Conventions & Best Practices

  • Docstrings: Every test function MUST have a descriptive docstring explaining exactly what it verifies.
  • Mocking: Mock external dependencies (like database repositories or third-party HTTP clients) when writing unit tests for services. Use the classes in tests/mocks/.
  • Fixture Scopes: Ensure all fixtures are explicitly scoped (e.g. scope="session").
  • Code Coverage: Ensure test coverage is strictly more than 80%.
  • Async loops: Use the default loop scopes defined in pyproject.toml (asyncio_default_fixture_loop_scope = "session" and asyncio_default_test_loop_scope = "session").
  • No need to add comments inside any of the test code. Docstrings are enough.

Example: Unit Test

async def test_add_todo_without_attachments(
    todo_service: TodoService,
    mock_todo_repository: MockTodoRepository,
) -> None:
    """Test that creating a Todo task without specifying attachment IDs persists the Todo correctly."""
    todo_data = TodoCreate(
        title="Buy groceries",
        description="Milk and bread",
        is_completed=False,
        attachment_ids=None,
    )
    todo = await todo_service.add(todo_data)
    assert len(mock_todo_repository.todos_db) == 1
    assert mock_todo_repository.todos_db[0].title == "Buy groceries"
    assert mock_todo_repository.todos_db[0].id == todo.id

Read the full file on GitHub · 63 lines

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. 1mo ago First seen · 63 lines · 24 tokens per session scan A 4b6dc1b972e8

Subscribe to this mod's changes

python-testing is a skill published in the GitHub repository aps08/fullstack-clean-architecture (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 24 tokens to every session and 717 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-08-31.

Related

Other skills, from other repositories

add-test

Add tests following project test patterns.

fpindej/netrock · 6 tokens

pytest-suite

Write or extend the backend test suite following this project's conventions. Use when adding tests for a new service/route/repository, when coverage is missing, or when asked to test a feature. Knows the mocked-session + httpx AsyncClient setup so tests run with no database.

vstorm-co/full-stack-ai-agent-template · 59 tokens

verify

Run full verification (backend build+test, frontend test+lint+check).

fpindej/netrock · 16 tokens

python-testing

Write or modify Python tests. Use when: adding new tests, understanding testing conventions, working with fixtures, writing FastAPI route tests, database tests, or following pytest patterns. DO NOT USE FOR RUNNING TESTS. If you are just running tests, not building them, you do not need this.

tedivm/robs_awesome_python_template · 64 tokens

init-verify

TEMPLATE-ONLY - verify changes against a fully running stack by instantiating the template, checking in the browser, then reverting every init artifact. Use whenever a change needs visual or runtime verification in the real app. Removed by init.sh, do not reference from skills that survive init.

fpindej/netrock · 58 tokens

pytest

Advanced Python unit testing framework for customer support tech enablement, covering FastAPI, SQLAlchemy, PostgreSQL, async operations, mocking, fixtures, parametrization, coverage, and comprehensive testing strategies for backend support systems.

manutej/luxor-claude-marketplace · 44 tokens