with one click
test-runner
// Run pytest and ruff lint/format checks for crawl4md. Use when: run tests, run lint, verify changes, check code quality, finalize code changes, validate implementation.
// Run pytest and ruff lint/format checks for crawl4md. Use when: run tests, run lint, verify changes, check code quality, finalize code changes, validate implementation.
| name | test-runner |
| description | Run pytest and ruff lint/format checks for crawl4md. Use when: run tests, run lint, verify changes, check code quality, finalize code changes, validate implementation. |
| argument-hint | Run all tests and lint checks and report results |
Run pytest and ruff checks, then return a structured report. Two-pass strategy: quiet run first, verbose re-run of failures only. Ruff checks only run when all tests pass.
This is the most important section.
Pytest runs take minutes. Run in a background terminal and ask the user to confirm when it's done:
run_in_terminal with isBackground=true. Record its terminal ID.vscode_askQuestions with a single-click button — no freeform input:
{
"questions": [{
"header": "Pytest status",
"question": "Pytest is running. Open the Terminal panel (Ctrl+`) to watch progress, then click Done when it finishes.",
"options": [{"label": "Done", "recommended": true}],
"allowFreeformInput": false
}]
}
Wait for the user to click Done before proceeding.get_terminal_output using the ID from step 1. Look for a completion indicator to parse results.Pytest completion indicators (at least one must appear in the output):
passed, failed, error, or no tests ranRuff commands finish in seconds. Run them directly — no confirmation needed:
run_in_terminal with isBackground=false.Ruff completion indicators:
Found N error, All checks passed, or a shell prompt (> or $ at start of line)would be reformatted, already formatted, or a shell promptThis project has core library tests plus a separated Streamlit app test suite. Verbose output would be too large to parse. Use the two-pass strategy below.
python -m pytest tests/ -q
Run using the pytest user-confirmation strategy above.
Only run this if Step 1 reported failures:
python -m pytest tests/ --lf -v --tb=long
Run using the pytest user-confirmation strategy above. This re-runs only the last-failed tests with full tracebacks. Record each failure with its full traceback.
If tests still fail after Step 2, skip Steps 3–8 and go directly to Step 9.
python -m pytest apps/streamlit/tests/ -q
Run using the pytest user-confirmation strategy above.
Only run this if Step 3 reported failures:
python -m pytest apps/streamlit/tests/ --lf -v --tb=long
Run using the pytest user-confirmation strategy above. Record each failure with its full traceback.
If tests still fail after Step 4, skip Steps 5–8 and go directly to Step 9.
Only proceed if all tests passed. If any tests failed, skip to Step 9.
python -m ruff check src/ tests/
Run using the ruff direct strategy above.
python -m ruff format --check src/ tests/
Run using the ruff direct strategy above.
python -m ruff check apps/streamlit/streamlit_app.py apps/streamlit/src/ apps/streamlit/tests/
Run using the ruff direct strategy above.
python -m ruff format --check apps/streamlit/streamlit_app.py apps/streamlit/src/ apps/streamlit/tests/
Run using the ruff direct strategy above.
## Test Results
- Status: PASSED / FAILED
- Core actual: X passed, Y failed, Z errors
- App actual: X passed, Y failed, Z errors
- Failed tests: (list each with full traceback from Step 2 or Step 4, or "None")
## Lint Results
- core ruff check: PASSED / FAILED (N errors) / SKIPPED (tests failed)
- core ruff format: PASSED / FAILED (N files need reformatting) / SKIPPED (tests failed)
- app ruff check: PASSED / FAILED (N errors) / SKIPPED (tests failed)
- app ruff format: PASSED / FAILED (N files need reformatting) / SKIPPED (tests failed)
- Error details: (list each, or "None")
## Summary
- Overall: ALL CLEAR / ISSUES FOUND
- (If issues found, list the specific files and line numbers that need attention)
python -m pytest tests/ -v without --lf — the full verbose output is too largepython -m pytest instead of bare pytest — ensures the correct environment is usedpython -m ruff instead of bare ruff — ensures the correct environment is used[HINT] Download the complete skill directory including SKILL.md and all related files