Python teams need consistent pytest workflows for unit tests, FastAPI tests, fixtures, and coverage. This skill gives Claude, Codex, and Claude Code practical commands and patterns for pytest projects that use uv.
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Agent request
Review the Skillstore skill "pytest-mastery" from https://skillstore.io/skills/abdullahmalik17-pytest-mastery.md and its manifest at https://skillstore.io/api/skills/abdullahmalik17-pytest-mastery/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.
Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Static analysis flagged URLs, database strings, subprocess use, and many Markdown backticks. Review found these are local testing examples or a fixed pytest runner with shell execution disabled, and no prompt injection or malicious intent was found.
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
AbdullahMalik17. (2026). pytest-mastery security audit report (audit version 10) [Author version unspecified]. Skillstore. https://skillstore.io/skills/abdullahmalik17-pytest-mastery/audits/10
BibTeX citation
@techreport{abdullahmalik17-abdullahmalik17-pytest-mastery-2026,
author = {AbdullahMalik17},
title = {pytest-mastery security audit report (audit version 10)},
institution = {Skillstore},
year = {2026},
number = {10},
url = {https://skillstore.io/skills/abdullahmalik17-pytest-mastery/audits/10},
note = {Author version unspecified}
}
CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "pytest-mastery security audit report (audit version 10)"
version: "unspecified"
type: report
authors:
- name: "AbdullahMalik17"
date-released: "2026-07-09"
url: "https://skillstore.io/skills/abdullahmalik17-pytest-mastery/audits/10"
identifiers:
- type: other
value: "skillstore:abdullahmalik17-pytest-mastery:audit:10"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this scoreEvidence Confidence: High
64
Architecture
85
Maintainability
87
Content
70
Community
83
Spec Compliance
What You Can Build
Add tests to a Python feature
Create pytest files, fixtures, and parametrized cases for new Python code while using uv commands to run them.
Validate FastAPI endpoints
Set up TestClient or async httpx tests, override dependencies, and verify authentication, models, uploads, and error responses.
Improve test feedback in a project
Run targeted tests, debug failures, generate coverage reports, and configure pytest options in pyproject.toml.
Try These Prompts
Run my pytest suite
Use pytest-mastery to run my Python test suite with uv. Start with the standard verbose command and explain any failures in simple terms.
Write tests for a module
Use pytest-mastery to write pytest tests for this module. Include fixtures where helpful and show the uv command to run only the new tests.
Test a FastAPI endpoint
Use pytest-mastery to add FastAPI tests for this endpoint. Include TestClient setup, dependency overrides if needed, and assertions for success and validation errors.
Design a complete test plan
Use pytest-mastery to design a pytest plan for this service. Cover fixtures, parametrization, async tests, database setup, coverage targets, and useful pytest configuration.
Best Practices
Run the smallest relevant test target first, then run the full suite before finishing work.
Keep fixtures focused on setup and teardown that multiple tests actually share.
Use parametrization when the same behavior should be checked across multiple inputs.
Avoid
Do not hide failing tests with broad skip or xfail markers without a clear reason.
Do not place slow integration setup in every unit test when a narrower fixture will work.
Do not treat coverage percentage as proof that important behavior is tested.
Frequently Asked Questions
Does this skill require uv?
The examples use uv commands. You can adapt the pytest patterns to other Python package managers if needed.
Can it help write FastAPI tests?
Yes. It includes TestClient, async httpx, database fixture, dependency override, authentication, upload, WebSocket, and error response patterns.
Can it generate coverage reports?
Yes. It documents pytest-cov commands for terminal, HTML, XML, and minimum threshold reports.
Does it run commands automatically?
No. It provides command patterns and a local helper script. Users or their AI coding tool decide when to run them.
Is it only for unit tests?
No. It covers unit-style tests, integration markers, FastAPI endpoint tests, database tests, and background task mocking.
Can it debug failed tests?
Yes. It lists pytest options for long tracebacks, debugger entry, local variables, and rerunning previously failed tests.