- Test runner for Python's
unittest - Orders tests by dependencies — foundational modules first
- Skips tests unaffected by your changes
pip install rut
rut # all tests, smart order
rut --changed # only affected tests
Full usage guide →
How it works
Order tests by dependencies
Foundational modules run first, so when something breaks you see the root cause immediately — not 300 cascading failures.
Read more →
Skip tests unaffected by your changes
rut --changed runs only affected tests — tests that depend on files you modified. Test impact analysis that typically cuts test time by 50–80%.
Core Features
Async Support
Built-in support for async test methods. No plugins needed.
Keyword Filtering
Filter tests by name with -k. Run exactly what you need.
Fail Fast
Exit on the first failure with -x. Pairs well with dependency ordering.
Coverage
Code coverage with --cov. No extra configuration.
Comparison
vs python -m unittest
No smart ordering, no way to skip unaffected tests, no -k, no coverage. rut adds what's missing.
vs pytest
Great ecosystem and plugin support. rut takes a different approach — instead of replacing the test framework, it focuses on making the runner itself smarter (dependency ordering, affected-only runs) while staying on stdlib unittest.
Articles
How rut Builds the Import Dependency Graph
Static import analysis at the module level. How rut understands your codebase structure to order tests and skip unaffected ones.
Migrating from pytest to rut
A practical guide for converting a pytest test suite to rut. Includes AI-agent-friendly instructions.