python-testing

Create pytest test suites with TDD workflows and coverage reporting.

2|Updated May 11, 2026
One-click install
npx skills add https://github.com/himanshu231204/AI_Research_agent --skill python-testing-himanshu231204
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-testing
Source: https://github.com/himanshu231204/AI_Research_agent/tree/main/.opencode/skills/python-testing
Command: npx skills add https://github.com/himanshu231204/AI_Research_agent --skill python-testing-himanshu231204

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the common pain points of inconsistent Python test suites, low code coverage, and ad-hoc testing practices that lead to undetected bugs in production Python applications.

Core Features & Use Cases

  • TDD Workflow Guidance: Enforces the red-green-refactor cycle to catch bugs early during feature development.
  • pytest Best Practices: Covers fixtures, parametrization, markers, and assertion patterns for maintainable, readable test suites.
  • Mocking & Coverage Setup: Provides patterns for mocking external dependencies and configuring 80%+ code coverage requirements for critical paths.
  • Use Case: A Python developer building a new FastAPI endpoint can use this Skill to write failing tests first, mock database calls, and ensure the endpoint has 100% test coverage before deployment.

Quick Start

Use the python-testing skill to create a pytest test suite for your new Python module that follows TDD workflows, includes mocked external service calls, and meets 80% code coverage requirements.

Frequently Asked Questions about python-testing

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

FAQPage Schema
How do I build a pytest test suite with TDD workflows and mocked external dependencies?

Building a pytest test suite with TDD involves enforcing the red-green-refactor cycle, using pytest fixtures and parametrization, and mocking external dependencies to ensure robust tests and 80%+ code coverage for critical paths.

What is the best way to parametrize tests and use fixtures in pytest?

The best way to parametrize tests and use fixtures in pytest is applying implementation patterns for test fixtures, markers, and assertion patterns, which creates maintainable and readable test suites for new feature testing.

How do I mock database calls and external services when testing a Python application?

Mocking database calls and external services in Python testing requires applying specific mocking patterns for external dependencies, isolating the code under test to verify behavior without hitting live services or actual databases.

Can I enforce 80% code coverage requirements for critical paths in my Python project?

You can enforce 80% code coverage requirements for critical paths by configuring coverage reporting tools within your pytest infrastructure, eliminating low code coverage issues that cause undetected production bugs in Python applications.

Does Test Driven Development with pytest work for testing new FastAPI endpoints?

Test Driven Development with pytest works effectively for testing new FastAPI endpoints by writing failing tests first, mocking database calls, and ensuring the endpoint meets 100% test coverage before deployment.