testing-patterns

Configure pytest fixtures, mocking, async tests, and CI integration for Python.

3|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/pvliesdonk/agents.md --skill testing-patterns-pvliesdonk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/pvliesdonk/agents.md/tree/main/skills/testing-patterns
Command: npx skills add https://github.com/pvliesdonk/agents.md --skill testing-patterns-pvliesdonk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive strategies and patterns for writing effective, maintainable, and robust tests for Python applications, ensuring code quality and reliability.

Core Features & Use Cases

  • Pytest Configuration: Set up pyproject.toml for efficient testing, including markers and warnings.
  • Fixture Patterns: Implement scoped, factory, and temporary path fixtures for cleaner test setup.
  • Mocking Strategies: Effectively mock LLM APIs, structured outputs, and environment variables.
  • Async & Property-Based Testing: Write asynchronous tests and leverage Hypothesis for property-based testing.
  • CI Integration: Examples for integrating tests into GitHub Actions workflows.

Quick Start

Configure your project's testing setup using the provided pytest and coverage configurations.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
What is the best way to mock LLM API responses in pytest?

Pytest fixture patterns provide scoped, factory, and temporary path setups that cleanly manage test dependencies, reducing boilerplate and ensuring maintainable test suites across your Python application.

How do I configure pytest in pyproject.toml for markers and warnings?

Property-based testing with Hypothesis generates diverse test cases automatically, validating edge cases in your Python code by asserting universal properties hold true across generated inputs.

Can I integrate pytest tests into GitHub Actions CI workflows?

Asynchronous testing in pytest uses dedicated async support to execute and validate coroutines, ensuring your async Python code paths behave correctly within the test suite.

What are the limitations of mocking environment variables in Python tests?

Pytest configuration in pyproject.toml centralizes test settings including markers and warnings, providing a standardized environment that improves consistency across local and CI test runs.