Engineering
pytest-runner avatar

pytest-runner

Automate pytest execution with built-in environment verification, failure analysis, coverage reporting, and intelligent test discovery.

Introduction

The pytest-runner skill is a specialized agentic workflow designed for Python software developers and QA engineers. It provides a robust, safe, and repeatable interface for running test suites while minimizing common failure modes associated with automated testing. By enforcing a grounding-first architecture, it ensures that your Python virtual environment, dependencies, and pytest configuration are correctly set up before any code execution occurs. This prevents environment drift and common runtime errors like import failures or missing fixtures.

  • Intelligent test discovery: Automatically identifies test files matching naming patterns and displays collection results before running.

  • Safety-first execution: Integrates environment checks, including virtual environment activation, to ensure tests run in the intended context.

  • Comprehensive coverage: Supports automatic generation of coverage reports (terminal and HTML) to identify untested code paths.

  • Failure analysis and recovery: Captures test output, logs failures, and maps them to standard Pytest error types like ImportError, FixtureError, or syntax issues.

  • Flexible configuration: Manages markers, keywords, and parallel execution patterns natively without requiring manual script modifications.

  • Uncertainty handling: Implements clear escalation protocols for ambiguous scenarios such as multiple test directories or unclear thresholds.

  • Intended for developers managing Python test suites using pytest, pytest-xdist, and coverage.py.

  • Best used for CI/CD pipeline local validation, unit testing, integration tests, and regression analysis.

  • Requires local access to project files including pytest.ini or pyproject.toml.

  • Always verifies the presence of pip packages and virtual environments before performing file operations.

  • Input: Test suite directory, optional markers, or specific failure analysis requirements.

  • Output: Test results log, coverage summary report, failure diagnosis, and, if enabled, detailed coverage HTML reports.

  • Follows strict architectural guidelines to ensure separation of concerns between test execution and application code structure.

Repository Stats

Stars
124
Forks
18
Open Issues
1
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 08:03 AM
View on GitHub