Skip to content

Pytest-style python test runner powered by Rust - built for speed πŸš€

License

Notifications You must be signed in to change notification settings

Apex-Engineers-Inc/rustest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

114 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

rustest logo

Rustest is a Rust-powered pytest-compatible test runner delivering 8.5Γ— average speedup with familiar pytest syntax and zero setup.

πŸ“š Full Documentation | Getting Started | Migration Guide

πŸš€ Try It Now

Run your existing pytest tests with rustest β€” no code changes required:

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 β†’

Installation

pip install rustest
# or
uv add rustest

Python 3.10-3.14 supported. πŸ“– Installation Guide β†’

Quick Start

Write a test in test_example.py:

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:

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 β†’

Learn More

Contributing

Contributions welcome! See the Development Guide for setup instructions.

License

MIT License. See LICENSE for details.

About

Pytest-style python test runner powered by Rust - built for speed πŸš€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •