pytest

Apply pytest patterns for fixtures, mocks, and parametrized tests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write robust Python tests by applying pytest patterns for fixtures, mocks, parameterization, and markers to reduce boilerplate and improve reliability.

Core Features & Use Cases

  • Fixtures for reusable setup across tests and modules
  • Parametrize to cover multiple inputs with a single test
  • Mocking to isolate dependencies and simulate scenarios
  • Async tests support for asynchronous code and pytest-asyncio
  • Organization via conftest.py and test modules

Quick Start

Create a simple test using a fixture and a parametrized case, then run pytest to execute it.

Frequently Asked Questions about pytest

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

FAQPage Schema
How do I write reusable setup code for Python unit tests using fixtures?

Parametrize covers multiple inputs in a single Python test by mapping variable names to value tuples, eliminating repetitive test functions. This pattern reduces boilerplate while maintaining comprehensive coverage for various input scenarios.

Does pytest support async tests for asynchronous Python code?

Yes, pytest supports async tests for asynchronous Python code through pytest-asyncio. This allows you to execute and validate asynchronous functions directly within your test modules alongside standard synchronous tests.

What is the best way to isolate dependencies in Python integration tests?

Mocking isolates dependencies in Python integration tests by simulating external modules and scenarios. Applying mock objects prevents actual side effects, ensuring your test execution remains reliable and focused on the target module logic.

How do I organize test modules and shared fixtures in a Python project?

You organize test modules and shared fixtures using a conftest.py file. This centralizes fixture definitions and makes them accessible across your directory structure, streamlining test automation and reducing redundant setup code.