Skip to content
Back to skills

Pytest Config

ASecurity

Provides standardized pytest config, reusable fixtures, and CI integration patterns. Use when setting up or auditing a Python plugin's test infrastructure.

  • 342 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added December 19, 2025
developmentpythongobashtestinggitci/cd

Works with

  • claude code

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 6 files and shows the line behind each finding

Scanned September 20, 2026

npx -y skills add athola/claude-night-market --skill pytest-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pytest Config?

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

Security grade badge for Pytest Config
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/athola-pytest-config/badge)](https://www.skillsdirectory.com/skills/athola-pytest-config)

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: pytest-config
description: Provides standardized pytest config, reusable fixtures, and CI integration patterns. Use when setting up or auditing a Python plugin's test infrastructure.
globs: ["**/conftest.py", "**/pytest.ini", "**/pyproject.toml"]
alwaysApply: false
category: infrastructure
tags:
- pytest
- testing
- configuration
- fixtures
dependencies:
- leyline:testing-quality-standards
estimated_tokens: 200
provides:
  infrastructure:
  - pytest-config
  - conftest-patterns
  - coverage-config
modules:
- modules/conftest-patterns.md
- modules/git-testing-fixtures.md
- modules/mock-fixtures.md
- modules/ci-integration.md
- modules/README.md
model_hint: standard
---

# Pytest Configuration Patterns

Standardized pytest configuration and patterns for consistent testing infrastructure across Claude Night Market plugins.


## When To Use

- Setting up pytest configuration and fixtures
- Configuring conftest.py patterns for test infrastructure

## When NOT To Use

- Non-Python projects or projects using other test frameworks
- Simple scripts that do not need test infrastructure

## Quick Start

### Basic pyproject.toml Configuration

```toml
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
    "-v",
    "--cov=src",
    "--cov-report=term-missing",
    "--cov-fail-under=80",
    "--strict-markers",
]
markers = [
    "unit: marks tests as unit tests",
    "integration: marks tests as integration tests",
    "slow: marks tests as slow running",
]

[tool.coverage.run]
source = ["src"]
omit = ["*/tests/*", "*/migrations/*", "*/__pycache__/*"]
branch = true

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "def __str__",
    "raise NotImplementedError",
    "if __name__ == .__main__.:",
    "if TYPE_CHECKING:",
    "class .*\\bProtocol\\):",
    "@(abc\\.)?abstractmethod",
]
precision = 2
show_missing = true
```
**Verification:** Run `pytest --collect-only` to verify discovery, `pytest -v --co -q` for markers, and `pytest --cov` for coverage thresholds.

## Detailed Patterns

For detailed implementation patterns, see:

- **[Conftest Patterns](modules/conftest-patterns.md)** - Conftest.py templates, fixtures, test markers, and directory structure
- **[Git Testing Fixtures](modules/git-testing-fixtures.md)** - GitRepository helper class for testing git workflows
- **[Mock Fixtures](modules/mock-fixtures.md)** - Mock tool fixtures for Bash, TodoWrite, and other Claude Code tools
- **[CI Integration](modules/ci-integration.md)** - GitHub Actions workflows and test commands for automated testing
- **Module Index**: See `modules/README.md` for module organization overview

## Integration with Other Skills

This skill provides foundational patterns referenced by:
- `parseltongue:python-testing` - Uses pytest configuration and fixtures
- `pensive:test-review` - Uses test quality standards
- `sanctum:test-*` - Uses conftest patterns and Git fixtures

Reference in your skill's frontmatter:
```yaml
dependencies: [leyline:pytest-config, leyline:testing-quality-standards]
```

## Exit Criteria

- pytest configuration standardized across plugins
- conftest.py provides reusable fixtures
- test markers defined and documented
- coverage configuration enforces quality thresholds
- CI/CD integration configured for automated testing
## Troubleshooting

### Common Issues

**Tests not discovered**
Ensure test files match pattern `test_*.py` or `*_test.py`. Run `pytest --collect-only` to verify.

**Import errors**
Check that the module being tested is in `PYTHONPATH` or install with `pip install -e .`

**Async tests failing**
Install pytest-asyncio and decorate test functions with `@pytest.mark.asyncio`

Files in this skill

  • SKILL.md2.7 KB
  • modules/README.md2.2 KB
  • modules/ci-integration.md2 KB
  • modules/conftest-patterns.md3.9 KB
  • modules/git-testing-fixtures.md2.6 KB
  • modules/mock-fixtures.md2 KB

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…