pytest_runner
Run pytest tests on files, functions, or entire test suites with options for verbosity, markers, and failure handling.
Instructions
Run pytest tests on specific files, test functions, or entire test suite
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to test file or directory (optional, defaults to current directory) | . |
| capture | No | Capture mode: 'no' (disable), 'sys' (capture stdout/stderr), 'fd' (capture file descriptors) | sys |
| markers | No | Run tests with specific markers (e.g., '-m slow' or '-m "not slow"') | |
| maxfail | No | Stop after N test failures | |
| verbose | No | Run with verbose output (-v flag) | |
| extra_args | No | Additional pytest arguments | |
| test_class | No | Specific test class to run (e.g., 'TestMyClass') | |
| last_failed | No | Run only tests that failed in the last run (--lf flag) | |
| collect_only | No | Only collect tests, don't run them (--collect-only flag) | |
| failed_first | No | Run failed tests first, then remaining tests (--ff flag) | |
| test_pattern | No | Test pattern to match (e.g., 'test_*_integration') | |
| very_verbose | No | Run with very verbose output (-vv flag) | |
| test_function | No | Specific test function to run (e.g., 'test_my_function') |