pytest-review

Analyze Python test code for pytest best-practice violations and suggest fixes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Elijah-J/InfoScraper --skill pytest-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-review
Source: https://github.com/Elijah-J/InfoScraper/tree/main/.agents/skills/pytest-review
Command: npx skills add https://github.com/Elijah-J/InfoScraper --skill pytest-review

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reviews Python test files against pytest best practices and refactors to comply. Checks fixtures, assertions, markers, parametrization, monkeypatching, tmp_path usage, and test organization. Use when reviewing test code, auditing test quality, or refactoring unittest-style tests to idiomatic pytest.

Core Features & Use Cases

  • Review targets for pytest adherence, identify anti-patterns, and propose concrete refactors.
  • Validate fixture design, parametrization coverage, monkeypatch usage, and test organization.
  • Provide actionable guidance for updating tests from unittest style to pytest idioms.

Quick Start

Run the pytest-review skill on your test suite to identify and refactor violations to pytest best practices.

Frequently Asked Questions about pytest-review

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

FAQPage Schema
How do I refactor unittest-style tests to pytest idioms?

You can audit Python test code to identify pytest best-practice violations and suggest fixes for fixtures, parametrization, marks, and monkeypatching. It reviews test suites across multiple files to improve reliability and readability.

How do I validate pytest fixture design and parametrization coverage?

Validating pytest fixture design and parametrization coverage requires analyzing test files to detect anti-patterns and propose concrete refactors. This ensures fixtures and parametrized tests adhere to pytest best practices for optimal reliability.

What is the best way to audit test quality and identify pytest anti-patterns?

The best way to audit test quality is to review targets for pytest adherence, identifying anti-patterns in monkeypatching and tmp_path usage. This analysis flags potentially unsafe patterns and provides actionable guidance for refactoring.

Does pytest-review work with test suites spanning multiple files and directories?

Yes, pytest-review targets typical pytest suites across multiple files, detecting dependencies and components by directory structure. It ensures safety by flagging potentially unsafe patterns found during the multi-file test analysis.

Why does my monkeypatching usage violate pytest best practices?

Monkeypatching usage violates pytest best practices when applied unsafely or outside idiomatic patterns. Auditing the test code flags these potentially unsafe patterns and provides actionable guidance to correct the monkeypatch implementation.