rut

A Python unittest runner with test impact analysis, dependency ordering, and incremental testing.

  • 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

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

internals

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.

Read article →
how-to

Migrating from pytest to rut

A practical guide for converting a pytest test suite to rut. Includes AI-agent-friendly instructions.

Read article →