squid-testing-python

squid-testing-python is a skill for Claude Code from iusztinpaul/squid. It costs 32 tokens per session (1,119 once invoked), scanned A, original, Apache-2.0.

Guidelines for writing Python tests with pytest, a tool that runs automated tests. They cover small single-purpose tests, clear naming, and the setup–run–check pattern.

In plain words
What is it for?
Use them when writing, reviewing, debugging, or improving pytest tests for Python code.
Why use it?
They make failing tests easier to understand and help reveal which parts of a Python module still lack coverage.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the squid plugin — 15 skills, 5 agents shipped together

Good fit Use them when writing, reviewing, debugging, or improving pytest tests for Python code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iusztinpaul/squid/squid-testing-python
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 iusztinpaul/squid --skill squid-testing-python
Clone the repo
git clone --depth 1 https://github.com/iusztinpaul/squid

Made for: Claude Code.

Or install squid, the plugin that ships this one along with the rest of its 15 skills, 5 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/iusztinpaul/squid/squid-testing-python/github.svg)](https://agentmods.dev/skills/iusztinpaul/squid/squid-testing-python)
Your own site
<a href="https://agentmods.dev/skills/iusztinpaul/squid/squid-testing-python"><img src="https://agentmods.dev/badge/skills/iusztinpaul/squid/squid-testing-python/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 squid-testing-python

Your own site · 80×15
<a href="https://agentmods.dev/skills/iusztinpaul/squid/squid-testing-python"><img src="https://agentmods.dev/badge/skills/iusztinpaul/squid/squid-testing-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,119 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00032 $0.01119
Opus 5.5 $0.00013 $0.00448
Sonnet 5.5 $0.00006 $0.00224
Haiku 4.5 $0.00003 $0.00112

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

Security

Grade A, and why

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

skills/squid-testing-python/SKILL.md · 175 lines

How it starts

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

Writing Effective Python Tests

Test Structure

Mirror the module layout

Keep a one-to-one relationship between test files and the modules they cover: myapp/service.py → tests/.../test_service.py. This makes the test for any given module obvious and keeps coverage gaps visible.

Follow AAA (Arrange, Act, Assert)

Structure each test body in three beats — set up inputs (Arrange), call the thing under test (Act), then assert on the result. Keep them in that order; don't interleave more setup after the act.

Atomic unit tests

Each test should verify a single behavior. The test name should tell you what's broken when it fails. Multiple assertions are fine when they all verify the same behavior.

# Good: Name tells you what's broken
def test_user_creation_sets_defaults():
    user = User(name="Alice")
    assert user.role == "member"
    assert user.id is not None
    assert user.created_at is not None

# Bad: If this fails, what behavior is broken?
def test_user():
    user = User(name="Alice")
    assert user.role == "member"
    user.promote()
    assert user.role == "admin"
    assert user.can_delete_others()

Use parameterization for variations of the same concept

import pytest

@pytest.mark.parametrize("input,expected", [
    ("hello", "HELLO"),
    ("World", "WORLD"),
    ("", ""),
    ("123", "123"),
])
def test_uppercase_conversion(input, expected):
    assert input.upper() == expected

Don't parameterize unrelated behaviors — if the test logic differs, write separate tests.

Project-Specific Rules

Imports at module level

Put ALL imports at the top of the file. Do not import inside test function bodies.

# Correct
import pytest
from myapp.service import do_work

def test_something():
    assert do_work() is not None

# Wrong - no local imports
def test_something():
    from myapp.service import do_work  # Don't do this
    ...

Async tests

If the project sets asyncio_mode = "auto" in pyproject.toml, write async tests without decorators:

Read the full file on GitHub · 175 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 Changed · -40 lines f7c84b01233f
  2. 1mo ago First seen · 215 lines · 32 tokens per session scan A 3eeb917f7ba2

Subscribe to this mod's changes

squid-testing-python is a skill published in the GitHub repository iusztinpaul/squid (210 stars, last pushed today), licensed Apache-2.0. It adds 32 tokens to every session and 1,119 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-30.