rpytest
Run your pytest suite faster. Change nothing.
rpytest is a Rust-powered, drop-in replacement for pytest that eliminates startup and collection overhead while keeping your existing tests, fixtures, and plugins completely untouched.
# Install and run - that's it
Why rpytest?
| Metric | pytest | rpytest | Improvement |
|---|---|---|---|
| Wall clock (480 tests) | 2.91s | 1.55s | 1.9x faster |
| CLI memory usage | 35.8 MB | 6.2 MB | 5.8x less |
The speed comes from a persistent daemon that keeps Python warm between runs. No more paying interpreter startup costs on every invocation.
Installation
# Via pip (recommended)
# Via cargo
# From source
&&
Usage
rpytest mirrors pytest's CLI exactly. If you know pytest, you know rpytest.
# Run all tests
# Run specific tests
# Filter by keyword or marker
# Parallel execution (pytest-xdist compatible, no plugin needed)
# Watch mode for TDD
# Verify identical behavior to pytest
Key Features
Instant Startup
The first run spawns a background daemon. Every subsequent run is a fast RPC call—no interpreter startup, no re-importing your test modules.
Full pytest Compatibility
- All pytest CLI flags work identically
- Your plugins, fixtures, and conftest.py files run unchanged
pytest.ini,pyproject.toml, andtox.iniconfigs are respected- Exit codes and JUnit XML match pytest exactly
Built-in Parallelism
No pytest-xdist required. Duration-aware load balancing included.
Watch Mode
File changes trigger automatic re-runs of affected tests.
Flakiness Detection
Sharding for CI
How It Works
- First run: Spawns a Python daemon that collects your test suite once
- Subsequent runs: Rust CLI filters tests and dispatches to warm Python workers
- Results stream back in real-time for instant feedback
The daemon persists between runs, so repeated invocations (TDD loops, CI retries, --last-failed) skip all the startup work.
Daemon Management
Drop-in Guarantee
Run the verification harness to confirm identical behavior:
This runs both pytest and rpytest on your suite and compares collection counts, pass/fail results, and exit codes.
Configuration
rpytest reads your existing pytest configuration—no new config files needed:
pytest.inipyproject.toml([tool.pytest.ini_options])tox.inisetup.cfg
Documentation
Full documentation at docs.neullabs.com/rpytest
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.