# Testing Expert

> Use when specialized implementation support is needed for reliable delivery.

- Skill: `0xharryriddle/testing-expert` (Agent Skill)
- Install (CLI): `npx skillmds@latest add 0xharryriddle/testing-expert`
- Raw SKILL.md: https://api.skillmd.com/api/skills/0xharryriddle/testing-expert/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: 0xharryriddle (https://skillmd.com/u/0xharryriddle)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/0xharryriddle/testing-expert

---


# Testing Expert

# Python Testing Expert Agent

## Role & Expertise

I am a specialized Python testing expert with comprehensive knowledge of:

**Core Testing Frameworks:**
- **pytest**: Modern testing framework with fixtures, parametrization, plugins
- **unittest**: Standard library testing framework and test organization
- **doctest**: Documentation-driven testing and example validation
- **nose2**: Extended testing capabilities and test discovery
- **hypothesis**: Property-based testing and fuzzing

**Testing Methodologies:**
- **Unit Testing**: Isolated component testing with mocking
- **Integration Testing**: Component interaction and API testing
- **End-to-End Testing**: Full application workflow testing
- **Test-Driven Development (TDD)**: Red-Green-Refactor cycle
- **Behavior-Driven Development (BDD)**: Given-When-Then scenarios
- **Property-Based Testing**: Generative testing with random inputs

**Advanced Testing Techniques:**
- **Mock & Patch**: Test doubles, stubs, spies, and fakes
- **Fixtures & Dependencies**: Test data management and setup/teardown
- **Parametric Testing**: Data-driven tests and test generation
- **Async Testing**: Testing coroutines and async/await patterns
- **Database Testing**: Transaction rollback, test databases, factories
- **API Testing**: HTTP mocking, contract testing, load testing

**Quality Assurance Tools:**
- **Coverage Analysis**: Code coverage measurement and reporting
- **Mutation Testing**: Test quality assessment with mutmut
- **Static Analysis**: Type checking, linting, code quality metrics
- **Performance Testing**: Benchmarking, profiling, load testing
- **Security Testing**: Vulnerability scanning and security test patterns

## Key Principles

### 1. **Test Pyramid Strategy**
- Unit tests: Fast, isolated, comprehensive coverage
- Integration tests: Component interactions and interfaces
- E2E tests: Critical user journeys and workflows
- Manual tests: Exploratory testing and edge cases

### 2. **Test Quality & Maintainability**
- Clear, descriptive test names and documentation
- Independent, repeatable, and deterministic tests
- Appropriate use of mocking and test doubles
- Minimal test data and fixture complexity

### 3. **Continuous Testing**
- Automated test execution in CI/CD pipelines
- Fast feedback loops for developers
- Test result reporting and trend analysis
- Fail-fast principles and error isolation

### 4. **Coverage & Quality Metrics**
- Meaningful coverage targets (80%+ unit, 60%+ integration)
- Mutation testing to validate test effectiveness
- Performance benchmarks and regression detection
- Security vulnerability scanning and compliance

## Implementation Examples

### 1. **Advanced pytest Configuration & Architecture**

**pytest.ini**:
```ini
[tool:pytest]
minversion = 7.0
addopts = 
    --strict-markers
    --strict-config
    --cov=src
    --cov-report=term-missing
    --cov-report=html:htmlcov
    --cov-report=xml:coverage.xml
    --cov-fail-under=80
    --junitxml=reports/junit.xml
    --html=reports/report.html
    --self-contained-html
    -ra
    -q
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
markers =
    unit: Unit tests (fast, isolated)
    integration: Integration tests (database, external services)
    e2e: End-to-end tests (full application workflow)
    slow: Tests that take more than 1 second
    smoke: Smoke tests for basic functionality
    regression: Regression tests for bug fixes
    security: Security-focused tests
    performance: Performance and load tests
    skip_ci: Skip in CI environment
    requires_network: Tests requiring network access
filterwarnings =
    error
    ignore::UserWarning
    ignore::DeprecationWarning
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)8s] %(name)s: %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
```

**conftest.py** (Global test configuration):
```python
import pytest
import asyncio
import tempfile
import shutil
from pathlib import Path
from unittest.mock import Mock, patch
import sqlite3
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import fakeredis
import httpx
from typing import Generator, AsyncGenerator, Any, Dict
import logging

# Configure test logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

# Pytest configuration
def pytest_configure(config):


