python-testing

Automate pytest test execution and generate coverage and HTML reports.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides end-to-end testing capabilities with pytest, fixtures, and coverage reporting for Python projects.

Core Features & Use Cases

  • Execute tests with various scopes (all, selected, failed, changed)
  • Generate test reports and coverage metrics
  • Create and organize tests with fixtures and parametrization
  • Integrate tests with project structure and CI

Quick Start

Run all tests with pytest (e.g., uv run pytest) and generate reports. Example: uv run pytest

Frequently Asked Questions about python-testing

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

FAQPage Schema
How do I run Python tests with pytest and generate coverage reports?

Pytest automates test execution and coverage reporting for Python projects. Run `pytest` to discover and execute all tests, then integrate coverage tools to generate detailed metrics and HTML reports across your test suite, supporting selective execution, fixtures, and parametrized tests.

What's the best way to organize unit and integration tests in a Python project?

Use pytest fixtures and conftest.py to organize tests with reusable setup and teardown logic. Structure tests by scope—unit, integration, or targeted subsets—and leverage parametrization and markers to manage test discovery and selective execution efficiently.

Can I run only failed or specific tests with pytest?

Pytest supports selective execution via flags like -k for keyword filtering, --lf for last-failed tests, and -x to stop on first failure. This lets you target specific test subsets without running your entire suite, speeding up iteration during development.

How do pytest fixtures improve test code quality?

Fixtures provide reusable test dependencies and setup orchestration defined in conftest.py, eliminating duplication and improving maintainability. They handle complex initialization, teardown, and state management across unit and integration tests.

Does pytest work with CI/CD pipelines for automated testing?

Pytest integrates seamlessly with CI/CD systems to automate test execution, coverage collection, and reporting. It produces machine-readable output and coverage metrics, enabling continuous validation of test suites across your project structure.