testing-expert
Use when specialized implementation support is needed for reliable delivery.
- License 许可
- MIT
- 最近更新
- 2026-04-11
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- testing-expert
- metadata
- { "hermes": { "tags": [ "codex-agent", "languages-runtime" ], "source": "codex-field-kit/languages-runtime" } }
- description
- Use when specialized implementation support is needed for reliable delivery.
03 SKILL.md 正文
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:
[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):
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):
04 同仓库更多 Skills
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
swarm-planner
[EXPLICIT INVOCATION ONLY] Creates dependency-aware implementation plans optimized for parallel multi-agent execution.
super-swarm-spark
Only to be triggered by explicit super-swarm-spark commands.
role-creator
Create and install Codex custom agent roles in ~/.codex/config.toml, generate role config files, enforce supported keys, and guide users through required role inputs (model, reasoning effort, developer_instructions).
read-github
Read and search GitHub repository documentation via gitmcp.io MCP service. **WHEN TO USE:** - User provides a GitHub URL - User mentions a specific repo in owner/repo format - User asks "what does this repo do?", "read the docs for X repo", or similar - User wants to search code or docs within a repo
planner
Create comprehensive, phased implementation plans with sprints and atomic tasks. Use when user says: "make a plan", "create a plan", "plan this out", "plan the implementation", "help me plan", "design a plan", "draft a plan", "write a plan", "outline the steps", "break this down into tasks", "what's the plan for", or any similar planning request. Also triggers on explicit "/planner" or "/plan" commands.