Python test (structured)
python_testRuns pytest and returns structured test results with pass/fail counts and failure messages, listing only failures by default for compact output.
Instructions
Run pytest and return structured test results: suites, pass/fail counts, failure messages. Much more compact than raw test output. Only failures are listed by default; use verbose=true for all tests.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cwd": "<cwd>"
},
"name": "python_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Project root directory | |
| path | No | Specific test path or file to run | |
| pattern | No | Filter tests by expression (-k pattern) | |
| verbose | No | Include all tests in output (default: only failures) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| suites | Yes | ||
| summary | Yes | ||
| retained | No |