pytest

Automate Python testing workflows with pytest fixtures, parametrization, mocking, and markers.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/dtaborda/quiz-experience --skill pytest-dtaborda
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest
Source: https://github.com/dtaborda/quiz-experience/tree/main/skills/pytest
Command: npx skills add https://github.com/dtaborda/quiz-experience --skill pytest-dtaborda

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python testing can be brittle and hard to maintain without reusable fixtures, clear test organization, and reliable mocking. Pytest provides a mature framework to write scalable tests with fixtures, parameterization, and expressive assertions.

Core Features & Use Cases

  • Fixtures and setup patterns: Reusable test setup for consistent state across tests.
  • Parametrization and markers: Create data-driven tests and categorize them for selective runs.
  • Mocking and isolation: Techniques to stub and mock dependencies to keep tests focused and fast.
  • Real-world use: Write unit tests for a Python service, run with pytest, and verify outcomes and edge cases.

Quick Start

Install pytest, write a simple test using a fixture, and run pytest to execute tests and see the results.

Frequently Asked Questions about pytest

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

FAQPage Schema
How do I write reliable Python tests with reusable fixtures?

Python testing with pytest uses reusable fixtures to manage setup state and keep tests maintainable. Fixtures provide consistent contexts across test functions, enabling scalable unit and integration tests without repeating initialization logic.

What is the best way to parametrize data-driven tests in Python?

Parametrization in pytest allows you to run a single test function against multiple data sets. By applying parametrization markers, you generate data-driven tests that execute automatically across varying inputs to verify edge cases.

Does pytest work for both unit and integration testing in Python services?

Pytest supports both unit and integration testing for Python projects of varying sizes. You apply custom markers to categorize tests, enabling selective runs across your codebase whether testing isolated functions or combined service components.

How do I use markers to categorize and selectively run pytest tests?

Markers in pytest let you label test functions with custom metadata for selective execution. You apply built-in or custom markers to categorize tests by type or feature, then run pytest targeting only those marked subsets.