
Pytest Config
Wire pytest into GitHub Actions with coverage, markers, and multi-version Python matrices for a solo builder’s repo.
Install
npx skills add https://github.com/athola/claude-night-market --skill pytest-configWhat is this skill?
- Copy-paste GitHub Actions test.yml for push and pull_request triggers
- pytest CLI recipes: coverage, markers, failed-first, parallel (-n auto), -x, -l
- Matrix strategy example for Python 3.10, 3.11, and 3.12
- Codecov upload step paired with --cov-report=xml
- Parent skill leyline:pytest-config; reusable for .github/workflows/test.yml
Adoption & trust: 1 installs on skills.sh; 304 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Azure Kubernetesmicrosoft/azure-skills
Github Actions Docsxixu-me/skills
Deploy To Vercelvercel-labs/agent-skills
Vercel Cli With Tokensvercel-labs/agent-skills
Turborepovercel/turborepo
Docker Expertsickn33/antigravity-awesome-skills
Journey fit
Common Questions / FAQ
Is Pytest Config safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Pytest Config
# CI/CD Integration GitHub Actions workflows and test commands for automated testing. ## Common Test Commands ```bash # Run all tests pytest # Run with coverage pytest --cov=src --cov-report=html # Run specific markers pytest -m unit pytest -m "not slow" # Run failed tests first pytest --failed-first # Parallel execution pytest -n auto # Verbose output with print statements pytest -v -s # Stop on first failure pytest -x # Show local variables in tracebacks pytest -l ``` ## GitHub Actions Workflow ```yaml # .github/workflows/test.yml name: Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - run: pip install -e ".[dev]" - run: pytest --cov --cov-report=xml - uses: codecov/codecov-action@v4 ``` ## Multi-Python Version Testing ```yaml # .github/workflows/test.yml name: Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - run: pip install -e ".[dev]" - run: pytest --cov --cov-report=xml - uses: codecov/codecov-action@v4 if: matrix.python-version == '3.12' ``` ## Makefile Integration ```makefile .PHONY: test test: pytest .PHONY: test-cov test-cov: pytest --cov=src --cov-report=html --cov-report=term .PHONY: test-fast test-fast: pytest -m "not slow" -x .PHONY: test-verbose test-verbose: pytest -v -s ``` --- name: conftest-patterns description: Conftest.py templates and fixtures for standardized pytest configuration across plugins parent_skill: leyline:pytest-config category: infrastructure tags: [pytest, fixtures, conftest, testing] estimated_tokens: 220 reusable_by: - "plugins/*/tests/conftest.py" - "test infrastructure setup" --- # Conftest.py Patterns Reusable conftest.py templates and fixture patterns for Claude Night Market plugin testing. ## Project-Specific conftest.py Template ```python """ Test configuration and shared fixtures for {plugin_name} plugin test suite. This module provides common fixtures, test data, and utilities for testing {plugin_name} skills, agents, and workflows. """ from __future__ import annotations import json import tempfile from pathlib import Path from typing import Any, Dict, List from unittest.mock import Mock import pytest # Plugin root for test data PLUGIN_ROOT = Path(__file__).parent.parent @pytest.fixture def plugin_root() -> Path: """Return the path to the plugin root directory.""" return PLUGIN_ROOT @pytest.fixture def temp_dir(tmp_path: Path) -> Path: """Provide a temporary directory for test isolation.""" return tmp_path @pytest.fixture(autouse=True) def isolate_tests(tmp_path: Path, monkeypatch): """Isolate tests by changing to temporary directory.""" monkeypatch.chdir(tmp_path) yield def pytest_configure(config): """Configure custom pytest markers.""" config.addinivalue_line( "markers", "unit: Mark test as unit test" ) config.addinivalue_line( "markers", "integration: Mark test as integration test" ) config.addinivalue_line( "markers", "slow: Mark test as slow running" ) ``` ## Sample Data Fixtures ```python @pytest.fixture def sample_skill_frontmatter() -> str: """Sample valid skill frontmatter content.""" return """--- name: example-skill description: Example skill for t