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.
Install
npx skills add UCSB-NLP-Chang/Skill-Usage --skill testing-pythongit clone --depth 1 https://github.com/UCSB-NLP-Chang/Skill-Usage.git /tmp/Skill-Usage
mkdir -p ~/.claude/skills
cp -r /tmp/Skill-Usage/tasks/fix-build-agentops/environment/skills/testing-python ~/.claude/skills/testing-pythonPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Writing Effective Python Tests
## Core Principles
Every test should be **atomic**, **self-contained**, and test **single functionality**. A test that tests multiple things is harder to debug and maintain.
## Test Structure
### 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.
```python
# 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
```python
import pytest
@pytest.mark.parametrize("input,expected", [
("hello", "HELLO"),
("World", "WORLD"),
("", ""),
("123", "123"),
])
def test_uppercase_conversion(input, expected):
assert input.upper() == expected
```
### Use separate tests for different functionality
Don't parameterize unrelated behaviors. If the test logic differs, write separate tests.
## Project-Specific Rules
### No async markers needed
This project uses `asyncio_mode = "auto"` globally. Write async tests without decorators:Details
- Skill name
testing-python- Repository
- UCSB-NLP-Chang/Skill-Usage
- Path
tasks/fix-build-agentops/environment/skills/testing-python/SKILL.md- Repo updated
- 8 April 2026
FAQ
What does the Testing Python skill do?
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.
How do I install the Testing Python skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add UCSB-NLP-Chang/Skill-Usage --skill testing-python. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Testing Python popular?
It lives in UCSB-NLP-Chang/Skill-Usage, which has 49 GitHub stars and 5 forks.
Related skills
Pubchem Database
49UCSB-NLP-Chang/Skill-Usage
Query PubChem via PUG-REST API/PubChemPy (110M+ compounds). Search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics.
Pymatgen
49UCSB-NLP-Chang/Skill-Usage
Materials science toolkit. Crystal structures (CIF, POSCAR), phase diagrams, band structure, DOS, Materials Project integration, format conversion, for computational materials science.
Rdkit
49UCSB-NLP-Chang/Skill-Usage
Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom sanitization, specialized algorithms.
A B Test Design
48sethdford/claude-skills
Design rigorous A/B tests with hypotheses, variants, metrics, and sample size calculations.
Excitation Signal Design
49UCSB-NLP-Chang/Skill-Usage
Design effective excitation signals (step tests) for system identification and parameter estimation in control systems.
A B Test Design Pm
48sethdford/claude-skills
Analytics and experimentation skill for product managers.
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.