pytest-fixture-generator
Generate standardized pytest configuration with fixtures, markers, and coverage settings. Creates conftest.py and pytest.ini for workspace-hub compliant testing.
Best use case
pytest-fixture-generator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate standardized pytest configuration with fixtures, markers, and coverage settings. Creates conftest.py and pytest.ini for workspace-hub compliant testing.
Teams using pytest-fixture-generator should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/pytest-fixture-generator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How pytest-fixture-generator Compares
| Feature / Agent | pytest-fixture-generator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate standardized pytest configuration with fixtures, markers, and coverage settings. Creates conftest.py and pytest.ini for workspace-hub compliant testing.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Pytest Fixture Generator
## Quick Start
```bash
# Generate pytest configuration
/pytest-fixture-generator
# Generate with specific markers
/pytest-fixture-generator --markers unit,integration,slow
# Generate for specific module structure
/pytest-fixture-generator --src-path src/modules
```
## When to Use
**USE when:**
- Setting up new Python project testing
- Standardizing existing test configuration
- Adding fixtures for data processing projects
- Configuring coverage requirements
**DON'T USE when:**
- Non-Python projects
- Tests already fully configured
- Different testing framework needed
## Prerequisites
- Python 3.9+
- pytest>=7.4.0
- pytest-cov>=4.1.0
- Project with src/ structure
## Overview
Generates complete pytest configuration including:
1. **pytest.ini** - pytest configuration with markers
2. **conftest.py** - Shared fixtures and path setup
3. **Coverage config** - .coveragerc or pyproject.toml
4. **Test templates** - Example test files
## Generated Files
### pytest.ini
```ini
[pytest]
testpaths = tests
python_files = test_*.py *_test.py
python_classes = Test*
python_functions = test_*
# Markers for test categorization
markers =
unit: Unit tests (fast, isolated)
*See sub-skills for full details.*
### conftest.py
```python
"""
ABOUTME: Pytest configuration and shared fixtures for testing
ABOUTME: Provides path setup, common fixtures, and test utilities
"""
import sys
from pathlib import Path
from typing import Any, Dict, Generator
import pytest
*See sub-skills for full details.*
### Example Test File
```python
"""
ABOUTME: Example test file demonstrating pytest patterns
ABOUTME: Shows usage of fixtures and markers
"""
import pytest
class TestExampleUnit:
*See sub-skills for full details.*
## Common Fixtures Reference
| Fixture | Scope | Purpose |
|---------|-------|---------|
| `project_root` | session | Project root path |
| `data_dir` | session | Data directory path |
| `test_data_dir` | session | Test fixtures path |
| `temp_output_dir` | function | Temporary output |
| `sample_dict` | function | Sample dictionary |
| `sample_dataframe` | function | Sample DataFrame |
| `sample_time_series` | function | Time series data |
| `temp_config` | function | Temp YAML config |
| `temp_csv` | function | Temp CSV file |
## Marker Reference
| Marker | Purpose | Example |
|--------|---------|---------|
| `@pytest.mark.unit` | Unit tests | Fast, isolated |
| `@pytest.mark.integration` | Integration tests | External resources |
| `@pytest.mark.slow` | Slow tests | > 1 second |
| `@pytest.mark.skip` | Skip test | Not ready |
| `@pytest.mark.xfail` | Expected failure | Known bug |
| `@pytest.mark.parametrize` | Multiple inputs | Test matrix |
## Related Skills
- [python-project-template](../python-project-template/SKILL.md) - Full project setup
- [repo-readiness](../repo-readiness/SKILL.md) - Verify test configuration
## References
- [pytest Documentation](https://docs.pytest.org/)
- [pytest-cov Documentation](https://pytest-cov.readthedocs.io/)
- [Testing Framework Standards](../../../docs/modules/standards/TESTING_FRAMEWORK_STANDARDS.md)
---
## Version History
- **1.0.0** (2026-01-14): Initial release - standardized pytest configuration with fixtures, markers, and coverage
## Sub-Skills
- [Example 1: Generate Basic Configuration (+2)](example-1-generate-basic-configuration/SKILL.md)
- [Best Practices](best-practices/SKILL.md)
## Sub-Skills
- [Execution Checklist](execution-checklist/SKILL.md)
- [Error Handling](error-handling/SKILL.md)Related Skills
interactive-report-generator
Generate interactive HTML reports with Plotly visualizations from data analysis results. Supports dashboards, charts, and professional styling.
orcaflex-reporting-fixture-proof-pattern
Build and extend fixture-backed OrcaFlex reporting proof paths in digitalmodel using stable metadata baselines, normalized HTML snapshots, and reusable reporting test helpers.
orcaflex-model-generator
Generate OrcaFlex modular models from spec.yml using builder registry pattern with conditional generation and cross-builder context sharing.
engineering-report-generator
Generate engineering analysis reports with interactive Plotly visualizations, standard report sections, and HTML export. Use for creating dashboards, analysis summaries, and technical documentation with charts.
orcaflex-model-generator-spec-variants
Sub-skill of orcaflex-model-generator: Spec Variants.
orcaflex-model-generator-pipeline-builders-order-10-50
Sub-skill of orcaflex-model-generator: Pipeline Builders (order 10-50) (+2).
orcaflex-model-generator-mergeobject
Sub-skill of orcaflex-model-generator: _merge_object() (+2).
orcaflex-model-generator-from-specyml-file
Sub-skill of orcaflex-model-generator: From spec.yml file (+3).
orcaflex-model-generator-builder-registry-pattern
Sub-skill of orcaflex-model-generator: Builder Registry Pattern (+3).
orcaflex-model-generator-3-way-benchmark
Sub-skill of orcaflex-model-generator: 3-Way Benchmark.
pytest-fixture-generator-example-1-generate-basic-configuration
Sub-skill of pytest-fixture-generator: Example 1: Generate Basic Configuration (+2).
engineering-report-generator-ex1-production-report
Sub-skill of engineering-report-generator: Example 1: Production Analysis Report (+2).