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
pip install rpytest
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.
# Via pip (recommended)
pip install rpytest
# Via Homebrew (macOS / Linux)
brew tap neul-labs/tap
brew install rpytest
# Via npm
npm install -g rpytest
# Via cargo (installs both the CLI and the daemon)
cargo install rpytest rpytest-daemon
# From source
git clone https://github.com/neul-labs/rpytest.git
cd rpytest
cargo install --path crates/rpytest
cargo install --path crates/rpytest-daemonNote: rpytest requires the
rpytest-daemonbinary to function. Both packages must be installed when usingcargo install.
rpytest mirrors pytest's CLI exactly. If you know pytest, you know rpytest.
# Run all tests
rpytest
# Run specific tests
rpytest tests/test_api.py::test_login
# Filter by keyword or marker
rpytest -k "auth" -m "not slow"
# Parallel execution (pytest-xdist compatible, no plugin needed)
rpytest -n auto
# Watch mode for TDD
rpytest --watch
# Verify identical behavior to pytest
rpytest --verify-dropinThe first run spawns a background daemon. Every subsequent run is a fast RPC call—no interpreter startup, no re-importing your test modules.
- 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
rpytest -n 4 # Run on 4 workers
rpytest -n auto # Auto-detect based on CPU coresNo pytest-xdist required. Duration-aware load balancing included.
rpytest --watchFile changes trigger automatic re-runs of affected tests.
rpytest --reruns 3 # Auto-retry failed tests
rpytest --flaky-report # See which tests are flakyrpytest --shard 0 --total-shards 4 # Perfect for parallel CI jobs- 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.
rpytest --daemon-status # Check health
rpytest --daemon-stop # Stop the daemon
rpytest --cleanup # Clean stale contextsRun the verification harness to confirm identical behavior:
rpytest --verify-dropinThis runs both pytest and rpytest on your suite and compares collection counts, pass/fail results, and exit codes.
rpytest reads your existing pytest configuration—no new config files needed:
pytest.inipyproject.toml([tool.pytest.ini_options])tox.inisetup.cfg
Full documentation at docs.neullabs.com/rpytest
Contributions welcome!
git clone https://github.com/neul-labs/rpytest.git
cd rpytest
cargo build
cargo testLicensed under the MIT License.