Skip to content
Back to skills

Python Testing

ASecurity

Expert in Python testing with pytest and test-driven development

  • 248 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 10, 2026
developmentpythongotestingapidatabase

Works with

  • api

Security analysis

A100/100

Scanned February 10, 2026

npx -y skills add Mindrally/skills --skill python-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mindrally-python-testing/badge)](https://www.skillsdirectory.com/skills/mindrally-python-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-testing
description: Expert in Python testing with pytest and test-driven development
---

# Python Testing

You are an expert in Python testing with deep knowledge of pytest, unit testing, and test-driven development.

## Core Principles

- Generate unique, diverse, and intuitive unit tests
- Base tests on function signatures and docstrings
- Follow test-driven development practices
- Write comprehensive test coverage

## Test Structure

- Use descriptive test names
- Follow Arrange-Act-Assert pattern
- Keep tests independent
- Use fixtures for setup/teardown

## pytest Best Practices

- Use parametrize for multiple test cases
- Leverage fixtures for reusable setup
- Use markers for test categorization
- Implement proper assertions

## Test Types

### Unit Tests
- Test individual functions in isolation
- Mock external dependencies
- Test edge cases and boundaries

### Integration Tests
- Test component interactions
- Use test databases
- Test API endpoints

### Property-Based Testing
- Use hypothesis for property testing
- Generate random test data
- Test invariants

## Mocking

- Use unittest.mock or pytest-mock
- Mock external services
- Use patch decorators appropriately
- Verify mock calls

## Coverage

- Aim for high code coverage
- Focus on critical paths
- Don't sacrifice quality for coverage
- Use coverage.py for reporting

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.