jmagly/aiwg/pytest-runner

Claude Code and agent skill by jmagly/aiwg

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Execute Python tests with pytest, supporting fixtures, markers, coverage, and parallel execution. Use for Python test automation.

Install

npx vskill@latest install jmagly/aiwg/pytest-runner

SKILL.md

Pytest Runner Skill

Purpose

Single responsibility: Execute and manage pytest test suites with proper configuration, coverage reporting, and failure analysis. (BP-4)

Grounding Checkpoint (Archetype 1 Mitigation)

Before executing, VERIFY:

  • [ ] Python virtual environment is active or available
  • [ ] pytest is installed (pip show pytest)
  • [ ] Test directory exists with test files
  • [ ] pytest.ini or pyproject.toml configured (optional)

DO NOT run tests without verifying environment.

Uncertainty Escalation (Archetype 2 Mitigation)

ASK USER instead of guessing when:

  • Multiple test directories detected - which to run?
  • Coverage threshold unclear
  • Parallel execution appropriate?
  • Specific markers or keywords needed?

NEVER modify test configurations without user approval.

Context Scope (Archetype 3 Mitigation)

Context TypeIncludedExcluded
RELEVANTTest files, pytest config, fixturesApplication code details
PERIPHERALCoverage reports, test markersCI/CD pipelines
DISTRACTOROther language testsDeployment configs

Workflow Steps

Step 1: Environment Check (Grounding)
bash
# Verify virtual environment
if [ -z "$VIRTUAL_ENV" ]; then
# Activate if exists
if [ -f "venv/bin/activate" ]; then
source venv/bin/activate
elif [ -f ".venv/bin/activate" ]; then
source .venv/bin/activate
else
echo "WARNING: No virtual environment active"
fi
fi
# Verify pytest installed
python -m pytest --version || pip install pytest
Step 2: Discover Tests
bash
# List all test files
find . -name "test_*.py" -o -name "*_test.py" | head -20
# Show pytest collection
python -m pytest --collect-only -q
Step 3: Execute Tests

Basic execution:

bash
python -m pytest tests/ -v

With coverage:

bash
python -m pytest tests/ -v --cov=src --cov-report=term-missing --cov-report=html

Parallel execution:

bash
python -m pytest tests/ -v -n auto # requires pytest-xdist

With markers:

bash
python -m pytest tests/ -v -m "unit"
python -m pytest tests/ -v -m "not slow"
Step 4: Analyze Results
bash
# Parse test results
python -m pytest tests/ -v --tb=short 2>&1 | tee test_results.txt
# Extract failures
grep -E "^FAILED|^ERROR" test_results.txt
# Coverage summary
python -m pytest --cov=src --cov-report=term | grep -E "^TOTAL|^Name"

Recovery Protocol (Archetype 4 Mitigation)

On error:

  1. PAUSE - Capture test output
  2. DIAGNOSE - Check error type:
  • ImportError → Check dependencies, PYTHONPATH
  • FixtureError → Check conftest.py
  • CollectionError → Check test file syntax
  • Timeout → Reduce test scope or add markers
  1. ADAPT - Adjust test selection or configuration
  2. RETRY - With narrower scope (max 3 attempts)
  3. ESCALATE - Report failures with context

Checkpoint Support

State saved to: .aiwg/working/checkpoints/pytest-runner/

checkpoints/pytest-runner/
├── test_collection.json # Discovered tests
├── test_results.json # Last run results
├── coverage_report.json # Coverage data
└── failure_analysis.md # Failure diagnostics

Common Pytest Options

OptionPurpose
-vVerbose output
-xStop on first failure
-sShow print statements
--lfRun last failed tests
--ffRun failed tests first
-k "pattern"Filter by name pattern
-m "marker"Filter by marker
--tb=shortShorter tracebacks

Configuration Templates

pytest.ini:

ini
[pytest]
testpaths = tests
python_files = test_*.py *_test.py
python_functions = test_*
addopts = -v --tb=short
markers =
unit: Unit tests
integration: Integration tests
slow: Slow tests

pyproject.toml:

toml
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
addopts = "-v --tb=short"

References

  • pytest documentation: https://docs.pytest.org/
  • REF-001: Production-Grade Agentic Workflows (BP-4 single responsibility)
  • REF-002: LLM Failure Modes (Archetype 1 grounding)

Security

  • Security scanPassed, 96 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
127
Repository forks
18
Repository npm downloads, 7 days
1,916
7-day trend score
43

Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 2 May 2026, 6 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jmagly/aiwg/pytest-runner/badge)](https://verified-skill.com/skills/jmagly/aiwg/pytest-runner)

Something wrong with this skill or its page? Tell us.