python-testing-general

Community

Write robust Python tests with pytest.

Authoramrahman90
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides comprehensive guidance and best practices for writing reliable, isolated, and maintainable tests in Python projects using pytest, addressing the challenges of ensuring code quality and preventing regressions.

Core Features & Use Cases

  • Test Structure and Conventions: Learn standard naming, the AAA pattern, and how to organize test files.
  • Test Isolation: Techniques for managing working directories, temporary files, and script path discovery.
  • Fixtures and Parametrization: Efficiently manage test setup, teardown, and data variations.
  • Mocking: Strategies for isolating code under test from external dependencies.
  • Assertions: Best practices for verifying test outcomes, including exceptions and approximate values.
  • Async Testing: How to test asynchronous Python code effectively.
  • Use Case: When developing a new feature in a Python application, use this Skill to ensure all new code is covered by well-structured, isolated, and maintainable pytest tests, including mocking external API calls and database interactions.

Quick Start

Use the python-testing-general skill to write pytest tests for the src/services/user.py file, including unit tests, mocking the database, and testing edge cases.

Dependency Matrix

Required Modules

None required

Components

scriptsreferences

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: python-testing-general
Download link: https://github.com/amrahman90/python-expert-agent/archive/main.zip#python-testing-general

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.