Rust powered pytest-compatible runner
Project description
rustest
Rustest (pronounced like Russ-Test) is a Rust-powered test runner that aims to provide the most common pytest ergonomics with a focus on raw performance. Get ~2x faster test execution with familiar syntax and minimal setup.
📚 Full Documentation | Getting Started | User Guide | API Reference
Why rustest?
- 🚀 About 2x faster than pytest on the rustest integration test suite
- ✅ Familiar
@fixture,@parametrize,@skip, and@markdecorators - 🔄 Built-in async support with
@mark.asyncio(like pytest-asyncio) - 🔍 Automatic test discovery (
test_*.pyand*_test.pyfiles) - 📝 Built-in markdown code block testing (like pytest-codeblocks, but faster)
- 🎯 Simple, clean API—if you know pytest, you already know rustest
- 🧮 Built-in
approx()helper for tolerant numeric comparisons - 🪤
raises()context manager for precise exception assertions - 📦 Easy installation with pip or uv
- ⚡ Low-overhead execution keeps small suites feeling instant
Performance
Rustest is designed for speed. Our latest benchmarks on the rustest integration suite (~200 tests) show a consistent 2.1x wall-clock speedup over pytest:
| Test Runner | Wall Clock | Speedup | Command |
|---|---|---|---|
| pytest | 1.33–1.59s | 1.0x (baseline) | pytest tests/ examples/tests/ -q |
| rustest | 0.69–0.70s | ~2.1x faster | python -m rustest tests/ examples/tests/ |
Large Parametrized Stress Test
With 10,000 parametrized invocations:
| Test Runner | Avg. Wall Clock | Speedup | Command |
|---|---|---|---|
| pytest | 9.72s | 1.0x | pytest benchmarks/test_large_parametrize.py -q |
| rustest | 0.41s | ~24x faster | python -m rustest benchmarks/test_large_parametrize.py |
📊 View Detailed Performance Analysis →
Installation
Rustest supports Python 3.10 through 3.14.
# Using pip
pip install rustest
# Using uv
uv add rustest
Quick Start
1. Write Your Tests
Create a file test_math.py:
from rustest import fixture, parametrize, mark, approx, raises
import asyncio
@fixture
def numbers() -> list[int]:
return [1, 2, 3, 4, 5]
def test_sum(numbers: list[int]) -> None:
assert sum(numbers) == approx(15)
@parametrize("value,expected", [(2, 4), (3, 9), (4, 16)])
def test_square(value: int, expected: int) -> None:
assert value ** 2 == expected
@mark.slow
def test_expensive_operation() -> None:
result = sum(range(1000000))
assert result > 0
@mark.asyncio
async def test_async_operation() -> None:
# Example async operation
await asyncio.sleep(0.001)
result = 42
assert result == 42
def test_division_by_zero() -> None:
with raises(ZeroDivisionError, match="division by zero"):
1 / 0
2. Run Your Tests
# Run all tests
rustest
# Run specific tests
rustest tests/
# Filter by test name pattern
rustest -k "test_sum"
# Filter by marks
rustest -m "slow" # Run only slow tests
rustest -m "not slow" # Skip slow tests
rustest -m "slow and integration" # Run tests with both marks
# Show output during execution
rustest --no-capture
Documentation
Getting Started
User Guide
- Writing Tests
- Fixtures
- Parametrization
- Marks & Skipping
- Test Classes
- Assertion Helpers
- Markdown Testing
- CLI Usage
- Python API
API Reference
Advanced Topics
Feature Comparison with pytest
Rustest implements the 20% of pytest features that cover 80% of use cases, with a focus on raw speed and simplicity.
📋 View Full Feature Comparison →
✅ Supported: Fixtures, parametrization, marks, test classes, conftest.py, markdown testing 🚧 Planned: Parallel execution, mark filtering, JUnit XML output ❌ Not Planned: Plugins, hooks, custom collectors (keeps rustest simple)
Contributing
We welcome contributions! See the Development Guide for setup instructions.
Quick reference:
# Setup
git clone https://github.com/Apex-Engineers-Inc/rustest.git
cd rustest
uv sync --all-extras
uv run maturin develop
# Run tests
uv run poe pytests # Python tests
cargo test # Rust tests
# Format and lint
uv run pre-commit install # One-time setup
git commit -m "message" # Pre-commit hooks run automatically
License
rustest is distributed under the terms of the MIT license. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rustest-0.6.0.tar.gz.
File metadata
- Download URL: rustest-0.6.0.tar.gz
- Upload date:
- Size: 201.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab2cc22a8016b907390ddcb9d8a141b00943920feae2a36b32e29386c11d89e4
|
|
| MD5 |
d44e41e445544c2352e57055af073fc7
|
|
| BLAKE2b-256 |
e6df689c55c068471ff039cc77ec5003228e2b36bf4137826bbf15a48f1dedc3
|
File details
Details for the file rustest-0.6.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: rustest-0.6.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 585.8 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5865c6f00f9df275197f8320adcd1ad322682d98a0cb3a474568956a432f27e
|
|
| MD5 |
b5b986dd988fce5a3e18d1362f55cac2
|
|
| BLAKE2b-256 |
4d13767abf3c3b92a6614ce828f36ce34103b402973a41edfe523e94f7f1f8ee
|
File details
Details for the file rustest-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 745.2 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86df45926e27bc4f4b9f796818e28c05dee4a1f837b54e0b46340c63b4037ecd
|
|
| MD5 |
a3038c054cc9d6662674fd924a95ab55
|
|
| BLAKE2b-256 |
985ba454beec93b8fcd08bc7e87774b28d9c3015375e3bf5a607dba9cb089cd6
|
File details
Details for the file rustest-0.6.0-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: rustest-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 666.6 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b5c6ad77b3e99addd954abdcc191834882282bcf98c83ed95982378f0f7e0c7
|
|
| MD5 |
4736fdd27960ed5a15bd95893b3dab34
|
|
| BLAKE2b-256 |
1399dfd13111c4f337ecabb5967b622b54c26ef0505e2fb90413bbae81fc1f56
|
File details
Details for the file rustest-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl
- Upload date:
- Size: 716.1 kB
- Tags: CPython 3.13, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80ae3d4cf096fdf64a0bcddab0954495717013d6e5c1e1a828f85efad502a46f
|
|
| MD5 |
22c463d476b52f299227058445c8903a
|
|
| BLAKE2b-256 |
c152877e0b904764a0dc10289f6ffa15fe0421a7e486efdfd029e54068895f64
|
File details
Details for the file rustest-0.6.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: rustest-0.6.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 585.8 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd1fdc483f77db2634a82081742c625d27f5143a24d86b70c0d99d60e1c6d83b
|
|
| MD5 |
e5a359975b4262baf3dc8bc7eae01dac
|
|
| BLAKE2b-256 |
d858fb1d1a51e2d40022eb85967fe8a6b89abded2eaaf8e8aede2be35e95ecd2
|
File details
Details for the file rustest-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 745.2 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e36917167e7171852f272be8adf626cf4c77a2736bed8d0690668fdaa362390e
|
|
| MD5 |
8d3de2746c24fc3412722be8f1a68bd9
|
|
| BLAKE2b-256 |
526dd8c3bd8ffe203f474375f43f83addb15b7e844de04ed3407f3f21634ff8a
|
File details
Details for the file rustest-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: rustest-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 666.6 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab98824080d68aa59b8137ceeec8b5b8424362f2bd4f4bd8a0b2234b72b10721
|
|
| MD5 |
3c8acd616afbef08755e6f70bce22be7
|
|
| BLAKE2b-256 |
8a6a248008e948ce14cb54be8a3b97198da59c49207033d2eb03042f77cbd159
|
File details
Details for the file rustest-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 716.3 kB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c493d15de79abd30d12c49d69578c9f2b675b38217ec71402b4f2b031b5cf8f9
|
|
| MD5 |
c8f295653225702e944d580516ff5c90
|
|
| BLAKE2b-256 |
835085b8516f11fa5c511065d225e3c6c8dc3297a06ce8de084e2ddd878cb365
|
File details
Details for the file rustest-0.6.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: rustest-0.6.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 587.2 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38aed7c494c5b0c168394bdc5233fa19cadf250a38c69204dfa4584ee20dfeb5
|
|
| MD5 |
d8618a9e6a87f42094e9f66a3a33c7d2
|
|
| BLAKE2b-256 |
82409f83ab4efc88567c43b781f0ea244523dd640c61c64b76b90fa98a075969
|
File details
Details for the file rustest-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 746.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7370fef01a533214123889437a7f5c549d27070bc9f366062c47f12c08c0a4f
|
|
| MD5 |
884cd0cb7ff59174d55ff294b7ebed7a
|
|
| BLAKE2b-256 |
e77d2cacceae65c261409a35933c2e19b714ce6807c48dcef5097c9ac3a65da8
|
File details
Details for the file rustest-0.6.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: rustest-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 666.8 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
540cb1eb49d06e47c108e97f999115d38ef31aad8ba9b2defc62784258d2fe9b
|
|
| MD5 |
b4c189cff482a4c2dd6d723699f30351
|
|
| BLAKE2b-256 |
a0701419fc06dcf5af1d398ac1f0ba8d0ceabf3fb601d26e51421d02bf40c418
|
File details
Details for the file rustest-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl
- Upload date:
- Size: 717.9 kB
- Tags: CPython 3.11, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9afe0dbe2e3b927b5c690db14981cf6915703f34e592a8e53b740f540e63ef2d
|
|
| MD5 |
292d0608696daba14d525d5b89a3db26
|
|
| BLAKE2b-256 |
7b0023dad5a8a37c119616c6de77b07a61e89916cd0db0f561831213ad50dd32
|
File details
Details for the file rustest-0.6.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: rustest-0.6.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 587.4 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e43717ceb566ffbcee23813c70d50116b01cce8277438eddae8f4817a875f05b
|
|
| MD5 |
ea31283166a33f0400dbea5f4b6a8bae
|
|
| BLAKE2b-256 |
0ad1422ff1f73b126b4880bd87e45fa6386037d05f321e4d7c8c826e405c7d14
|
File details
Details for the file rustest-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 746.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83b0e92eca69529577f27d73b3eb991c4623d4c6d69ee678782ccf469bbb1614
|
|
| MD5 |
91aecf498f6624b61b86fe4305cc5326
|
|
| BLAKE2b-256 |
11764d534292450ff45e1582c9c1468a826c87d08fc971fba24bb2c328647d10
|
File details
Details for the file rustest-0.6.0-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: rustest-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 667.1 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c16eecf36d8ae139afda2610022e6066476d4de18938aa7f9ec4cf51ebf3e27
|
|
| MD5 |
8aabe9c0b1cd707585d3d2270e26485c
|
|
| BLAKE2b-256 |
2f4c98d4d665d58514806975bbc0468d321766e9145543f38014d3b13aee3abc
|
File details
Details for the file rustest-0.6.0-cp310-cp310-macosx_10_12_x86_64.whl.
File metadata
- Download URL: rustest-0.6.0-cp310-cp310-macosx_10_12_x86_64.whl
- Upload date:
- Size: 718.0 kB
- Tags: CPython 3.10, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97482d34494b330680d605508157d46871907fa33990a27f85e3c222c9858e59
|
|
| MD5 |
b6d2c0ba5a23e069a9a64086be4bc7d6
|
|
| BLAKE2b-256 |
678c62b088eb774edb323c17bb0a6106c2e6146baa2616475f925ad740dfbda6
|