From leyline
Provides standardized pytest configuration, reusable fixtures (conftest patterns, git testing, mocks), and CI integration for Python plugin testing. Use when setting up or auditing test infrastructure.
How this skill is triggered — by the user, by Claude, or both
Slash command
/leyline:pytest-configThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Quick Start](#quick-start)
Standardized pytest configuration and patterns for consistent testing infrastructure across Claude Night Market plugins.
[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.
For detailed implementation patterns, see:
modules/README.md for module organization overviewThis skill provides foundational patterns referenced by:
parseltongue:python-testing - Uses pytest configuration and fixturespensive:test-review - Uses test quality standardssanctum:test-* - Uses conftest patterns and Git fixturesReference in your skill's frontmatter:
dependencies: [leyline:pytest-config, leyline:testing-quality-standards]
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
npx claudepluginhub athola/claude-night-market --plugin leylineGuides advanced Pytest usage including markers, custom assertions, hooks, and coverage configuration for Python testing projects.
Provides pytest patterns for unit, integration, and async testing with fixtures, mocking, and TDD. Use when writing or auditing Python test suites.
Guides writing pytest tests with fixtures, parametrize, markers, conftest, mocking, and advanced patterns for Python projects.