Skip to main content

rstest

CI OpenSSF Scorecard codecov PyPI Python versions Wheel License Downloads Docs GitHub stars

Runs most pytest suites unchanged, in parallel. Same fixtures, same plugins, parallel by default, with built-in suite diagnostics (--doctor) that tell you where your test time actually goes. How much faster depends on your suite's shape (self-check below).

Note: This is the Python test runner on PyPI (pip install rstest). It is not related to the Rust fixture crate rstest on crates.io.

Terminal recording: the aiohttp suite under pytest (193s), then rstest --doctor (67s, 14 parallel workers) pinpointing the wait-bound file that gates the suite

aiohttp's suite: pytest 193s → rstest 67s on a warm cache, then --doctor shows where the time goes. Recorded at -n auto (14 workers); the suite gains nothing past 8, so the tables below use -n 8.

📚 Full documentation → python-rstest.readthedocs.io

Quick start

In any pytest project:

pip install rstest      # or: uv pip install rstest
rstest

Also works with your tool of choice:

uv add --dev rstest           # uv projects
poetry add --group dev rstest # Poetry
pdm add -dG test rstest       # PDM

Install rstest into the same environment as your tests: workers run in that interpreter. A pipx / uv tool install alone can't run your tests; it only puts rstest on your PATH (details).

Requires Python 3.10+ on macOS (Apple silicon), Linux, or Windows (Windows is validated at a smaller scale than macOS/Linux). rstest is alpha (0.x): expect breaking changes between minor versions until 1.0.

No config and no test changes needed: rstest runs your pytest suite in parallel (-n auto) out of the box. As with pytest-xdist, session-scoped fixtures run once per worker, not once per run.

  • Tests that can't run in parallel (shared files, ports, databases) → @pytest.mark.serial (run exclusively, after the parallel phase).
  • Tests that depend on order within a file → --dist loadfile (keeps each file's tests on one worker); across files → rstest -n 0.
  • Want pytest's exact behavior → rstest -n 0 (single-worker mode: one pytest session, per-test outcomes match pytest exactly).

Will rstest speed up your suite?

The wins come from suite shape, not magic. Quick self-check:

Your suite What to expect
Wait-bound (IO, sleeps, network, timeouts) Biggest win: xdist's default --dist load hands out consecutive batches in collection order with no timing data, so a file of slow tests clusters on a few workers and starts late; rstest's duration cache starts the slowest tests first, spread across workers.
CPU-bound, already splits well under xdist No win, xdist can be slightly ahead: gain up to the performance-core count, same as xdist (sympy -n 8: rstest 16.0s vs xdist 14.3s).
Very many tests (100k+) Win over xdist: xdist's single Python controller becomes the bottleneck; rstest's orchestrator is Rust (pandas -n 8: 60s vs 123s).
Gated by one long test No win beyond that test: no worker count beats the long pole. --doctor names it.
Small (< ~10s serial) Little wall-time change: value is --watch, --changed, --doctor, not raw speed.
Many tiny per-service suites Speedup is per-suite; the aggregate CI win depends on your largest suites.

Two more things to know before you benchmark:

  • Warm cache matters. Duration-aware scheduling needs one run of timing data. First run is cold; the win arrives on run two. In ephemeral CI, persist .rstest_cache or expect cold-run timing.
  • Adopting rstest adopts pytest 9, whatever pytest you have installed (details).

Fastest way to find out for real: rstest try compares a plain pytest run with rstest -n auto and reports parity and speed, with no config (how it works).

Benchmarks

Real open-source suites, end-to-end, with per-test outcome diffing against the pytest baseline: 100% parity on all four suites in the measured warm runs (allauth and rich have tests that flake under plain pytest too, so some runs land at ~99.8-99.9%), and 99.91-99.98% on aiohttp's cold runs, whose socket-leak warning flake hits xdist too (every known flake is catalogued in the docs).

Suite Tests pytest xdist -n 8 rstest -n 8
aiohttp 4,469 196s 161s (73s with --dist worksteal) 67s warm · 150s cold
pandas 193,843 220s 123s 60s (xdist's controller pins a core)
django-allauth 2,050 28s 9.3s 6.3s
rich 981 3.8s 2.8s 2.6s

Apple M4 Max, CPython 3.13, rstest 0.11.0, pytest 9.2.0, pytest-xdist 3.8, median of 5 runs at the same -n for both runners. On CPU-bound suites (sympy, scikit-learn) xdist is at parity or up to 11% ahead; see the benchmarks page.

Monorepo (langchain-ai/langgraph, the 5 libs/* packages that need no live services, 838 tests, each with its own pytest config; a single pytest can't run from the root at all):

wall parity
pytest: 5 serial invocations 191.3s baseline
rstest at the root 25.6s (7.5×) 100%

Same method as above (median of 5, rstest -n auto). One of the five packages, libs/sdk-py, collects no tests under either runner in the benchmark venv (a missing test dependency), so the 838 tests come from the other four.

Full methodology: benchmarks.

Why rstest

pytest pytest-xdist rstest
Runs your suite unchanged ✅ parallel-safe tests parallel-safe tests; any suite at -n 0
Parallel by default ❌ ⚙️ opt-in ✅
Duration-aware scheduling plugin (pytest-split, across CI jobs) ❌ ✅
Crashed workers replaced mid-run ❌ ✅ ✅
Crash pinned to the exact test ❌ inferred from queue ✅ explicit per-test signal
Suite diagnostics ❌ ❌ ✅ --doctor
Watch mode plugin (pytest-watch) --looponfail (deprecated) ✅ built-in
  • Your tests, unchanged. A vendored pytest 9.2.0 core runs your conftest hierarchies, fixtures, parametrize, marks, and installed plugins (pytest-django, pytest-asyncio, hypothesis, pytest-mock, ...) as pytest does. Most pytest flags (-k, -m, -x, --lf, plugin flags) forward unchanged; a few, such as --timeout, --reruns and --html, are rstest's own with the same basic syntax as the plugins they replace.
  • xdist semantics in parallel. Session fixtures run once per worker, as under pytest-xdist, plus a short list of differences.
  • Parallel by design. Work distribution across worker processes, duration-aware scheduling that starts your slowest tests first (per test, or per file when a large suite gets lazy collection), and safety rails for tests that can't parallelize (@pytest.mark.serial, --dist loadfile).
  • Crash-safe. A segfaulting test costs you one FAILED line: the worker is replaced, its remaining tests redistribute, and the run completes.
  • rstest --doctor. Tells you why the suite is slow: tests that wait instead of compute, the long-pole tests that cap any parallelism, fixture hotspots, slowest files.
  • rstest --watch. Reruns on save; changed test files rerun alone, source changes rerun only the tests the import graph says are affected.

Compatibility contract. At -n 0 (single-worker mode) per-test outcomes match pytest exactly, and any difference is a bug (except for the few flags rstest shares with pytest or a plugin, which rstest handles itself at every worker count). In parallel, outcomes are preserved for parallel-safe tests, with the same caveats as pytest-xdist and a few report plugins that go quiet. Details: Compatibility and Known gaps.

rstest --doctor

Runs your suite, then answers where does the time actually go?, from data the runner already owns (per-test wall/CPU time, per-fixture setup):

================== rstest doctor ==================
4442 tests, 185.8s test time (wall 67.7s, 8 workers)

WAIT-BOUND: 95% of test time (176.5s) is waiting, not computing (sleeps / IO / timeouts).
    54.20s waiting of   54.25s  tests/test_proxy_functional.py::test_proxy_https_multi_conn_limit
    10.97s waiting of   10.97s  tests/test_proxy_functional.py::test_proxy_https_connect
  ... and 27 more

PARALLEL FLOOR: the longest test (54.2s) exceeds the ideal per-worker share (23.2s at -n 8);
no worker count can finish faster than its longest test. Gate tests:
    54.25s  tests/test_proxy_functional.py::test_proxy_https_multi_conn_limit

FIXTURE HOTSPOTS (setup time across all workers):
     0.79s   4442x  scope=function blockbuster
     0.54s    157x  scope=function transport

SLOWEST FILES:
   150.46s (81.0%)  tests/test_proxy_functional.py
     8.60s ( 4.6%)  tests/test_client_functional.py
===================================================

That's aiohttp's real suite: one file is 81% of total test time, almost all of it waiting on 10-second proxy timeouts. (Doctor counts tests with a recorded call duration, so skipped tests drop out: 4442 here against the 4,469 collected.) More →

Docs

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Metadata

Release files for rstest 0.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for rstest 0.11.1
File Actions
rstest-0.11.1-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for rstest-0.11.1-py3-none-win_arm64.whl
rstest-0.11.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for rstest-0.11.1-py3-none-win_amd64.whl
rstest-0.11.1-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for rstest-0.11.1-py3-none-musllinux_1_2_x86_64.whl
rstest-0.11.1-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for rstest-0.11.1-py3-none-musllinux_1_2_aarch64.whl
rstest-0.11.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for rstest-0.11.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
rstest-0.11.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for rstest-0.11.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
rstest-0.11.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for rstest-0.11.1-py3-none-macosx_11_0_arm64.whl

Total release size: 36.5 MB

Release files / rstest-0.11.1-py3-none-win_arm64.whl

Download URL rstest-0.11.1-py3-none-win_arm64.whl
Size 4.6 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
8672b899a424cb1833ceda4075cc85a7890c651bf10ecb08c5a21855219924c4
BLAKE2b-256 checksum
How to use checksums
594c77a71362d714187deccda757986caaa1dc2ee66b6f9821e069d173ff7359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / rstest-0.11.1-py3-none-win_amd64.whl

Download URL rstest-0.11.1-py3-none-win_amd64.whl
Size 4.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0dc08ef2881165df530f3f60d2e762bf4760b37eab2e5836dec4ea393aa2f2ca
BLAKE2b-256 checksum
How to use checksums
ab928126988a8fe02b1fd55141240e5ecdfd3a265cc42f61955a4aba907ee644
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / rstest-0.11.1-py3-none-musllinux_1_2_x86_64.whl

Download URL rstest-0.11.1-py3-none-musllinux_1_2_x86_64.whl
Size 5.7 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
9aeaebf99a87f5783fd180e7ca980125c23f6c13e43b503e6813520b2a5e9aeb
BLAKE2b-256 checksum
How to use checksums
b72954306c5864f830827d8d8277f15331be8d67b7b565b8af2414e47bafa5ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / rstest-0.11.1-py3-none-musllinux_1_2_aarch64.whl

Download URL rstest-0.11.1-py3-none-musllinux_1_2_aarch64.whl
Size 5.5 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
9b687656c6494dab7f1f023af78e8e0c7675166b19cf77c3af8a44490440c6a8
BLAKE2b-256 checksum
How to use checksums
4d4d91f5fb8f8c36cffa613256848f8163bf6ebb5bb8f7d142d296dd3c654544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / rstest-0.11.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL rstest-0.11.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 5.5 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b70d19ed6826fe6f2ceaa906823aabf62077682679442e4ddbd7aef6d106571c
BLAKE2b-256 checksum
How to use checksums
a265dd541fdf77b4e703ccab892c0178aef61394b6131ac7da465d653b7fd8fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / rstest-0.11.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL rstest-0.11.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
318c37a65dc228e9bbc7b3070c6c5b33ca60528f859b0d523c500c6bae5fe48a
BLAKE2b-256 checksum
How to use checksums
b770eb3a1d79bdcd257abe0b1b0980f6e7a38e3f23ec54e69dc81e9f4632f08c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / rstest-0.11.1-py3-none-macosx_11_0_arm64.whl

Download URL rstest-0.11.1-py3-none-macosx_11_0_arm64.whl
Size 4.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4248c81f2764aaf3b8f7377e0e018a67620ae4f4f1705026ec728349885538cd
BLAKE2b-256 checksum
How to use checksums
e7c766de064c5cb5f8945ab9a0511b75f3c7f5ec94cede4cc54e4ef4ef619b52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for rstest 0.11.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for rstest-0.11.1-py3-none-win_arm64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page