python-testing

Generate idiomatic pytest test suites with fixtures, parametrization, and mocking.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Maelwalser/claude-config --skill python-testing-maelwalser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-testing
Source: https://github.com/Maelwalser/claude-config/tree/main/skills/python-testing
Command: npx skills add https://github.com/Maelwalser/claude-config --skill python-testing-maelwalser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide clear, idiomatic guidance to write, maintain, and review Python tests so teams can catch regressions early, reduce flakiness, and ensure meaningful coverage across codebases.

Core Features & Use Cases

  • Establishes a TDD workflow (red, green, refactor) for iterative development and safer refactors.
  • Covers pytest fundamentals including fixtures, parametrization, mocking, async testing, markers, and coverage targets for CI.
  • Practical scenarios include unit, integration, API, and database testing plus strategies for organizing tests, conftest patterns, and test selection.

Quick Start

Create a pytest test suite for my Python package using fixtures, parametrized tests, mocks for external dependencies, and configure coverage to target 80% or higher.

Frequently Asked Questions about python-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write parametrized pytest tests with fixtures and mocks?

Pytest parametrized tests combine fixtures for setup and mocking for external dependencies to run the same test logic across multiple inputs. This approach isolates external calls while verifying varied scenarios produce expected outcomes.

What is the best way to configure pytest coverage targets for CI?

Configure pytest coverage targets for CI by enforcing an 80% or higher threshold within your pytest configuration. This ensures meaningful coverage across codebases, catching regressions early while preventing flaky or shallow tests from passing.

Does pytest support async testing for API and database integration tests?

Pytest supports async testing for API and database integration tests by applying idiomatic async patterns. You can validate asynchronous endpoints and database transactions directly within pytest workflows to ensure reliable integration behavior.

How do I establish a TDD workflow using pytest for Python projects?

Establish a TDD workflow using pytest by following the red, green, refactor cycle for iterative development. Write failing tests first, implement minimal code to pass, then refactor safely while maintaining meaningful coverage.

Why does my pytest test suite have flaky integration tests and how do I organize it?

Flaky pytest integration tests often stem from unmanaged external dependencies or poor fixture isolation. Organize tests using conftest patterns, markers for selection, and mocking to stabilize database and API interactions.