rpytest
v0.1.2
Published
Rust-powered, drop-in replacement for pytest
Maintainers
Readme
rpytest
Run your pytest suite faster. Change nothing.
A Rust-powered, drop-in replacement for pytest — installable via npm. Auto-downloads the correct native binary for your platform.
Why rpytest?
pytest -> 2.91s (480 tests)
rpytest -> 1.55s (same 480 tests)
= 1.9x fasterrpytest uses a persistent Rust daemon to keep Python warm between runs. No more interpreter startup costs on every invocation.
Installation
npm install -g rpytestThe postinstall script automatically detects your platform (macOS or Linux, Intel or Apple Silicon) and downloads the correct prebuilt native binary.
Usage
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 — no pytest-xdist needed
rpytest -n auto
# Watch mode for TDD
rpytest --watchKey Features
| Feature | pytest | rpytest |
|---------|--------|---------|
| Startup time | ~200ms | <10ms |
| Memory usage | 35.8 MB | 6.2 MB |
| Parallel workers | pytest-xdist plugin | Built-in -n flag |
| Watch mode | pytest-watch plugin | Built-in --watch |
| Flakiness detection | flaky plugin | Built-in --reruns |
| Sharding | pytest-shard plugin | Built-in --shard |
- Full pytest compatibility — plugins, fixtures, conftest.py, pytest.ini all work unchanged
- Built-in parallelism —
rpytest -n 4orrpytest -n auto - Watch mode — file changes trigger automatic re-runs of affected tests
- Flakiness detection —
rpytest --reruns 3auto-retries failed tests - Session fixture reuse —
rpytest --reuse-fixturespersists expensive fixtures - CI sharding —
rpytest --shard 0 --total-shards 4
Requirements
- Node.js 14+
- Python 3.9+ (for running tests)
- macOS or Linux
How It Works
- First run: Spawns a background daemon that collects your test suite
- Subsequent runs: Rust CLI filters tests and dispatches to warm Python workers
- Results stream back in real-time
The daemon persists between runs, so TDD loops and CI retries skip all startup work.
Install from Source
If no prebuilt binary is available for your platform:
git clone https://github.com/neul-labs/rpytest.git
cd rpytest && cargo install --path crates/rpytestDocumentation
Full docs at docs.neullabs.com/rpytest
License
MIT
