Skip to content
Development
Skill

/pytest-config

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

From plugin
claude-night-market
343200 skills60 agents162 commands1 MCP

Claude Code

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

SKILL.md

pytest-config.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

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

[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:

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`

Read more
@athola
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

343200 skills60 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
343
Star history of athola/claude-night-market on GitHub, a chart by star-history.com

Other skills on claude-night-market.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about pytest-config.

Which coding agents can use pytest-config?
pytest-config installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.