Agent Skill
2/7/2026

test

Execute test suite with specified scope (unit, module, integration, all, or affected). Reports results and coverage. Use to verify code changes. Can auto-trigger during task execution or when verification is needed.

C
choka30
0GitHub Stars
1Views
npx skills add choka30/danielhuencho.github.io

SKILL.md

Nametest
DescriptionExecute test suite with specified scope (unit, module, integration, all, or affected). Reports results and coverage. Use to verify code changes. Can auto-trigger during task execution or when verification is needed.

name: test description: Execute test suite with specified scope (unit, module, integration, all, or affected). Reports results and coverage. Use to verify code changes. Can auto-trigger during task execution or when verification is needed.

Test

Execute test suite with specified scope.

Scope Options

ScopeUsageCoverage
unit/test unit <test_file>Single test file
module/test module <module_name>All tests for a module
integration/test integrationCross-module tests
all/test allFull test suite
affected/test affectedTests related to recent changes

Execution Commands

Unit (Single File)

poetry run pytest tests/unit/test_<name>.py -v

Module

poetry run pytest tests/unit/test_<module>*.py -v --cov=src/<module>

Integration

poetry run pytest tests/integration/ -v

All

poetry run pytest tests/ -v --cov=src --cov-report=term-missing

Affected (Smart Selection)

# Get changed files
git diff --name-only HEAD~1

# Map to test files and run
poetry run pytest <affected_test_files> -v

Output Format

Success

═══════════════════════════════════════════════════════
  🧪 TEST RESULTS: [scope]
═══════════════════════════════════════════════════════

Passed:  NN ✓
Failed:  0
Skipped: N

Coverage: NN%

All tests passing.

Failure

═══════════════════════════════════════════════════════
  🧪 TEST RESULTS: [scope]
═══════════════════════════════════════════════════════

Passed:  NN ✓
Failed:  N ✗
Skipped: N

Coverage: NN%

Failed Tests:
─────────────────────────────────────────────────────────
1. tests/test_file.py::test_name
   Error: [brief error message]
   
   Suggestion: [potential fix]
─────────────────────────────────────────────────────────

Action Required: Fix failing tests before proceeding.

Coverage Targets

TypeMinimumTarget
Unit tests80%90%
Integration60%75%
Critical paths100%100%

Test Naming Convention

test_<unit>_<behavior>_<condition>

Examples:
- test_parse_config_returns_dict_when_valid
- test_parse_config_raises_when_file_missing
- test_user_authenticate_returns_none_when_expired

When to Run

SituationScope
After implementing a taskaffected or module
Before commitaffected
Before pushall
After mergeall
Debugging specific testunit

Debugging Failed Tests

# Run with more output
poetry run pytest tests/test_file.py::test_name -v --tb=long

# Run with debugger
poetry run pytest tests/test_file.py::test_name -v --pdb

# Run only last failed
poetry run pytest --lf -v
Skills Info
Original Name:testAuthor:choka30