| name | pytest-fixture-generator |
| description | Generate standardized pytest configuration with fixtures, markers, and coverage settings. Creates conftest.py and pytest.ini for workspace-hub compliant testing. |
| version | 1.0.0 |
| category | development |
| type | skill |
| trigger | manual |
| auto_execute | false |
| capabilities | ["pytest_configuration","fixture_generation","coverage_setup","marker_configuration","path_management"] |
| tools | ["Write","Read","Bash"] |
| related_skills | ["python-project-template"] |
| requires | [] |
| tags | [] |
Pytest Fixture Generator
Quick Start
/pytest-fixture-generator
/pytest-fixture-generator --markers unit,integration,slow
/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:
- pytest.ini - pytest configuration with markers
- conftest.py - Shared fixtures and path setup
- Coverage config - .coveragerc or pyproject.toml
- Test templates - Example test files
Generated Files
pytest.ini
[pytest]
testpaths = tests
python_files = test_*.py *_test.py
python_classes = Test*
python_functions = test_*
markers =
unit: Unit tests (fast, isolated)
*See sub-skills for full details.*
```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.*
```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.*
| 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 | 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 |
- (../python-project-template/SKILL.md) - Full project setup
- (../repo-readiness/SKILL.md) - Verify test configuration
- (https://docs.pytest.org/)
- (https://pytest-cov.readthedocs.io/)
- (../../../docs/modules/standards/TESTING_FRAMEWORK_STANDARDS.md)
---
- **1.0.0** (2026-01-14): Initial release - standardized pytest configuration with fixtures, markers, and coverage
- (example-1-generate-basic-configuration/SKILL.md)
- (best-practices/SKILL.md)
- (execution-checklist/SKILL.md)
- (error-handling/SKILL.md)