Running tests
Basic usage
Run all tests in your project:
Or without installing:
Specifying paths
Pass one or more file or directory paths to restrict which tests are collected:
file:line syntax
Jump to a specific test by pointing at the line where it's defined:
tryke runs the test whose definition spans that line. This is especially useful from editor integrations that can resolve the cursor position.
Collecting without running
Use --collect-only to list discovered tests without executing them:
This is useful for verifying filtering expressions or checking that tryke sees your tests.
Stopping on failure
Stop after the first failure with -x / --fail-fast:
Stop after N failures with --maxfail:
Parallel execution
tryke runs tests in parallel by default. The worker count defaults to min(test_count, cpu_count). Override with -j / --workers:
See concurrency for details on the worker pool model.
Project root
By default tryke uses the current directory as the project root. Override with --root:
The root determines where tryke looks for pyproject.toml, test files, and the import graph.
Filtering
See the filtering guide for -k expressions, -m tag filters, and how to combine them.
Reporter format
Choose an output format with --reporter:
See the reporters guide for all available formats.
Connecting to a server
If you have a tryke server running, connect to it for faster runs:
The server keeps Python workers warm and caches test discovery, so subsequent runs skip startup overhead.