If you're writing Python tests, this is the framework you should be using. It handles everything from simple assertions to complex integration tests with fixtures for dependency injection, parametrization for data-driven testing, and plugins for coverage, async, and mocking. The fixture system is genuinely better than setup/teardown methods, and parametrize decorators let you run the same test with different inputs without copy-pasting code. Works seamlessly with FastAPI, Django, and Flask, supports async/await natively, and the assertion introspection means you just write assert statements instead of assertEqual noise. Industry standard for good reason.

skills.sh installs
1.3K
GitHub stars
79
last updated
Aug 21, 2026

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill pytest --agent claude-code

Installs into .claude/skills of the current project.

Files

pytest - Professional Python Testing

Overview

pytest is the industry-standard Python testing framework, offering powerful features like fixtures, parametrization, markers, plugins, and seamless integration with FastAPI, Django, and Flask. It provides a simple, scalable approach to testing from unit tests to complex integration scenarios.

Key Features:

  • Fixture system for dependency injection
  • Parametrization for data-driven tests
  • Rich assertion introspection (no need for self.assertEqual)
  • Plugin ecosystem (pytest-cov, pytest-asyncio, pytest-mock, pytest-django)
  • Async/await support
  • Parallel test execution with pytest-xdist
  • Test discovery and organization
  • Detailed failure reporting

Installation:

# Basic pytest
pip install pytest

# With common plugins
pip install pytest pytest-cov pytest-asyncio pytest-mock

# For FastAPI testing
pip install pytest httpx pytest-asyncio

# For Django testing
pip install pytest pytest-django

# For async databases
pip install pytest-asyncio aiosqlite

Basic Testing Patterns

1. Simple Test Functions

# test_math.py
def add(a, b):
    return a + b

Sponsors

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Testing & QA, Python

More from bobmatnyc/claude-mpm-skills

All 158
1mindrally avatarci-cd-best-practicesmindrally/skillsCI/CD best practices for building automated pipelines, deployment strategies, testing, and DevOps workflows across platforms1.3Kskills.sh installs
2neolabhq avatargit-notesneolabhq/context-engineering-kitUse when adding metadata to commits without changing history, tracking review status, test results, code quality annotations, or supplementing commit messages p1.2Kskills.sh installs
3alirezarezvani avatargrill-mealirezarezvani/claude-skillsInterview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to s1.2Kskills.sh installs
4ruvnet avatargithub-release-managementruvnet/rufloComprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management1.2Kskills.sh installs
5eronred avatarpaywall-optimizationeronred/aso-skillsWhen the user wants to design, test, or optimize their app's paywall — layout, copy, pricing display, trial offers, plan structure, hard vs soft paywall, paywal1.1Kskills.sh installs
6getsentry avatarxcodebuildmcpgetsentry/xcodebuildmcpOfficial skill for XcodeBuildMCP. Use when doing iOS/macOS/watchOS/tvOS/visionOS work (build, test, run, debug, log, UI automation).1.1Kskills.sh installs