Generate a pytest test file for a Flask module
Generates a pytest test file for a specified module (router, service, or schema) with appropriate fixtures, async test methods, and standard test structure.
/new-test routers/projects # Creates tests/routers/test_projects.py
/new-test services/project # Creates tests/services/test_project_service.py
/new-test schemas/project # Creates tests/schemas/test_project.py
/new-test tasks/sync # Creates tests/tasks/test_sync.py
Read reference patterns. Load the test pattern from:
skills/new-test/references/test-examples.mdskills/test/references/pytest-patterns.mdpatterns/backend-patterns.mdDetermine test target. Parse the argument to determine what to test:
routers/projects generates HTTP integration tests using AsyncClientservices/project generates unit tests with AsyncSession fixtureschemas/project generates validation teststasks/sync generates Celery task testsRead the source module. Read the corresponding source file to understand the API surface: functions, methods, parameters, return types.
Generate the test file. Create the test module with:
from __future__ import annotationsRun quality checks.
uv run ruff format <test_file>
uv run ruff check <test_file>
uv run pytest <test_file> -v
Report results. Show the generated file and test results.
tests/<layer>/test_<module>.py
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer