pytest-dev

Automate pytest best-practice guidance and CI optimization for deterministic test suites.

5|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/BjornMelin/dev-skills --skill pytest-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-dev
Source: https://github.com/BjornMelin/dev-skills/tree/main/skills/pytest-dev
Command: npx skills add https://github.com/BjornMelin/dev-skills --skill pytest-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps teams build reliable, fast pytest suites and CI configurations by guiding test classification, deterministic practices, and CI hardening.

Core Features & Use Cases

  • Classify tests into unit/integration/system for selective execution and faster feedback.
  • Enforce deterministic fixtures and time control to reduce flakiness and enable reproducible results.
  • Harden CI workflows with strict markers, durations reporting, and optional test sharding for parallelism.
  • Provide performance tooling and templates via bundled references and scripts to detect bottlenecks and optimize test selection.

Quick Start

Run the bundled performance analysis workflow to identify slow tests and apply the recommended shard and CI tuning.

Frequently Asked Questions about pytest-dev

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

FAQPage Schema
How do I speed up pytest tests and reduce CI workflow execution time?

Reduce pytest flakiness by enforcing deterministic fixtures and time control mechanisms, which ensure reproducible results and eliminate test order dependencies or timing inconsistencies in your test suites.

What is the best way to identify slow pytest tests causing CI bottlenecks?

Identify slow pytest tests by running bundled performance analysis scripts like junit_slowest.py to measure test durations, detect bottlenecks, and apply recommended shard tuning and CI guardrails for optimization.

Can I use pytest xdist for shard-based parallelism in my existing CI workflows?

Harden CI workflows by applying strict pytest markers, configuring durations reporting, and implementing test sharding for parallelism, which collectively ensure fast, deterministic test suite execution and reduce pipeline failures.

Does pytest test classification require specific markers for selective execution?

Pytest test classification uses strict markers to categorize tests into unit, integration, and system tiers, enabling selective execution for faster feedback and preventing unintended test types from running in targeted CI stages.