SuperAPI AI Directory

test-generator

Testing & quality

View repository

Updated 10-16 18:25

About this skill

Test Generation Skill

Static Analysis

Tool Purpose Command
ruff Linter + Formatter uv run ruff check src/ --fix && uv run ruff format src/
mypy Type Checking uv run mypy src/ --ignore-missing-imports
bandit Security Scanning uv run bandit -r src/ -ll
vulture Dead Code Detection uv run vulture src/ --min-confidence 80

Complete:uv run ruff check src/; uv run mypy src/ --ignore-missing-imports; uv run bandit -r src/ -ll


Test Pyramid

Level Tool Directory
Unit pytest tests/unit/
Integration pytest + httpx tests/integration/
E2E playwright tests/e2e/
Coverage pytest-cov Target ≥80%

Unit tests must cover

  1. Happy Path — Normal flow
  2. Edge Cases — Boundary conditions
  3. Error Handling — pytest.raises
  4. Parametrize — @pytest.mark.parametrize

Execution Commands

pytest tests/unit -v                          # 單元
pytest tests/integration -v -m integration    # 整合
pytest --cov=src --cov-report=term-missing --cov-fail-under=80  # 覆蓋率

Checklist

  • Happy path + edge cases + error handling
  • Fixtures setup (conftest.py)
  • Coverage ≥ 80%
  • CI workflow integration