pytest

Automate creation and orchestration of pytest tests, fixtures, and configurations.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/MalikABK/panacloud_ass1 --skill pytest-malikabk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest
Source: https://github.com/MalikABK/panacloud_ass1/tree/main/.claude/skills/pytest
Command: npx skills add https://github.com/MalikABK/panacloud_ass1 --skill pytest-malikabk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Pytest is a comprehensive testing framework assistant that helps you quickly create, organize, and maintain robust Python tests, fixtures, and configurations, reducing boilerplate and improving reliability.

Core Features & Use Cases

  • Auto-discovery of test modules and functions
  • Flexible fixture management with scope control (function, class, module, session)
  • Parameterized testing and marks decorators (parametrize, xfail, skip)
  • Test organization and configuration management (pytest.ini, pyproject.toml, conftest)

Quick Start

Create a minimal test module with a simple function and a corresponding test using pytest to verify expected behavior.

Frequently Asked Questions about pytest

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

FAQPage Schema
How do I set up pytest fixtures with scope control across different test modules?

Pytest fixtures with scope control are managed through reusable conftest patterns, allowing you to define fixtures at function, class, module, or session scopes for organized test structure. This reduces boilerplate across modules.

What is the best way to run parameterized tests using pytest?

Parameterized testing in pytest uses marks decorators like parametrize to run the same test function against multiple inputs. This approach automates test orchestration and reduces redundant test code.

How does pytest auto-discovery work for finding test modules and functions?

Pytest auto-discovery automatically locates test modules and functions by scanning your project structure based on standard naming conventions. It requires clean configuration files like pytest.ini or pyproject.toml to define discovery rules.

Can I use pytest configuration management with pyproject.toml instead of pytest.ini?

Yes, pytest configuration management supports both pytest.ini and pyproject.toml formats. This allows you to centralize test discovery rules, fixture scopes, and marks decorators within your existing project configuration.

When should I use marks decorators like xfail or skip in pytest?

Marks decorators like xfail and skip are used in pytest when you need to conditionally bypass known failures or exclude specific parameterized tests from execution. They help maintain test suite reliability during transitions.

Do I need conftest.py files for every test directory to manage reusable fixtures?

You do not need conftest.py files for every directory; conftest patterns are used to share reusable fixtures across multiple test modules logically. Place them at the project root or in specific directories where fixture scope applies.