https://github.com/apex-engineers-inc/rustest
Pytest-style python test runner powered by Rust - built for speed ๐
https://github.com/apex-engineers-inc/rustest
python test testing unit-testing
Last synced: 7 months ago
JSON representation
Pytest-style python test runner powered by Rust - built for speed ๐
- Host: GitHub
- URL: https://github.com/apex-engineers-inc/rustest
- Owner: Apex-Engineers-Inc
- License: mit
- Created: 2025-11-04T20:35:07.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-07T01:08:03.000Z (7 months ago)
- Last Synced: 2025-12-07T23:39:28.772Z (7 months ago)
- Topics: python, test, testing, unit-testing
- Language: Python
- Homepage: https://apex-engineers-inc.github.io/rustest/
- Size: 977 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

Rustest is a Rust-powered pytest-compatible test runner delivering **8.5ร average speedup** with familiar pytest syntax and zero setup.
๐ **[Full Documentation](https://apex-engineers-inc.github.io/rustest)** | [Getting Started](https://apex-engineers-inc.github.io/rustest/getting-started/quickstart/) | [Migration Guide](https://apex-engineers-inc.github.io/rustest/from-pytest/migration/)
## ๐ Try It Now
Run your existing pytest tests with rustest โ no code changes required:
```bash
pip install rustest
rustest --pytest-compat tests/
```
See the speedup immediately, then migrate to native rustest for full features.
## Why Rustest?
- ๐ **8.5ร average speedup** over pytest (up to 19ร on large suites)
- ๐งช **pytest-compatible** โ Run existing tests with `--pytest-compat`
- โ
**Familiar API** โ Same `@fixture`, `@parametrize`, `@mark` decorators
- ๐ **Built-in async & mocking** โ No pytest-asyncio or pytest-mock plugins needed
- ๐ **Clear error messages** โ Vitest-style output with Expected/Received diffs
- ๐ **Markdown testing** โ Test code blocks in documentation
- ๐ ๏ธ **Rich fixtures** โ `tmp_path`, `monkeypatch`, `mocker`, `capsys`, `caplog`, `cache`, and more
## Performance
Rustest delivers consistent speedups across test suites of all sizes:
| Test Count | pytest | rustest | Speedup |
|-----------:|-------:|--------:|--------:|
| 20 | 0.45s | 0.12s | 3.8ร |
| 500 | 1.21s | 0.15s | 8.3ร |
| 5,000 | 7.81s | 0.40s | 19.4ร |
**Expected speedups:** 3-4ร for small suites, 5-8ร for medium suites, 11-19ร for large suites.
**[๐ Full Performance Analysis โ](https://apex-engineers-inc.github.io/rustest/advanced/performance/)**
## Installation
```bash
pip install rustest
# or
uv add rustest
```
**Python 3.10-3.14 supported.** [๐ Installation Guide โ](https://apex-engineers-inc.github.io/rustest/getting-started/installation/)
## Quick Start
Write a test in `test_example.py`:
```python
from rustest import fixture, parametrize, mark, raises
@fixture
def numbers():
return [1, 2, 3, 4, 5]
def test_sum(numbers):
assert sum(numbers) == 15
@parametrize("value,expected", [(2, 4), (3, 9)])
def test_square(value, expected):
assert value ** 2 == expected
@mark.asyncio
async def test_async():
result = 42
assert result == 42
def test_exception():
with raises(ZeroDivisionError):
1 / 0
```
Run your tests:
```bash
rustest # Run all tests
rustest tests/ # Run specific directory
rustest -k "test_sum" # Filter by name
rustest -m "slow" # Filter by mark
rustest --lf # Rerun last failed
rustest -x # Exit on first failure
```
**[๐ Full Documentation โ](https://apex-engineers-inc.github.io/rustest)**
## Learn More
- **[Getting Started](https://apex-engineers-inc.github.io/rustest/getting-started/quickstart/)** โ Complete quickstart guide
- **[Migration from pytest](https://apex-engineers-inc.github.io/rustest/from-pytest/migration/)** โ 5-minute migration guide
- **[User Guide](https://apex-engineers-inc.github.io/rustest/guide/writing-tests/)** โ Fixtures, parametrization, marks, assertions
- **[API Reference](https://apex-engineers-inc.github.io/rustest/api/overview/)** โ Complete API documentation
## Contributing
Contributions welcome! See the [Development Guide](https://apex-engineers-inc.github.io/rustest/advanced/development/) for setup instructions.
## License
MIT License. See [LICENSE](LICENSE) for details.