Skip to content

rustest

rustest logo
**Fast, Familiar Python Testing** Rust-powered test runner with pytest-compatible API
pip install rustest

Which describes you?

  • 🌱 New to Testing


    Learn why automated testing helps you write better code

    Testing catches bugs before your users do. We'll show you how to:

    • Write your first test in 5 minutes
    • Catch errors automatically
    • Make code changes with confidence
    • Build better software faster

    No experience needed. We'll teach you everything from scratch in a friendly, approachable way.

    Start Learning

  • πŸš€ Coming from pytest


    Speed up your test suite β€” 8.5Γ— faster on average

    Same decorators you know. Dramatically faster execution.

    What you get:

    • βœ… Drop-in compatible: @fixture, @parametrize, @mark
    • βœ… Built-in async support (no pytest-asyncio plugin)
    • βœ… Built-in mocking (no pytest-mock plugin)
    • βœ… Simple coverage integration (no plugin dance)
    • βœ… 5-minute migration for most projects

    Try it now:

    rustest --pytest-compat tests/
    

    See Feature Comparison Quick Migration Guide


πŸ’­ Why Rustest Exists

Short version: Python testing is too slow. We can do better.

Longer version: I love pytestβ€”the API is elegant, fixtures are powerful, and good tests make better code. But if you've used vitest or bun test in JavaScript/TypeScript, you know what fast testing feels like:

  • Tests run in milliseconds, not seconds
  • You get instant feedback on every save
  • TDD becomes enjoyable, not tedious
  • You stay in flow instead of context-switching

Why doesn't Python have this?

Rustest brings that experience to Python. Same pytest API you know, backed by Rust's performance. Fast tests aren't just convenientβ€”they change how you develop.

Our Philosophy

Pytest nailed the API. Rustest brings the speed.


See It In Action

from rustest import fixture, parametrize, mark

@fixture
def database():
    db = Database()
    yield db
    db.close()

@parametrize("username,expected", [
    ("alice", "alice@example.com"),
    ("bob", "bob@example.com"),
])
def test_user_email(database, username, expected):
    user = database.get_user(username)
    assert user.email == expected

@mark.asyncio
async def test_async_api():
    response = await fetch_data()
    assert response.status == 200

Run with: rustest

Output:

βœ“βœ“βœ“

βœ“ 3/3 3 passing (15ms)


πŸ“ˆ Performance That Scales

Suite Size Speedup
Small (< 20 tests) 3-4Γ— faster
Medium (100-500 tests) 5-8Γ— faster
Large (1,000+ tests) 11-19Γ— faster

View Full Performance Analysis


Production Ready

  • βœ… MIT Licensed
  • βœ… Python 3.10-3.14
  • βœ… Active Development

  • βœ… Built-in async support

  • βœ… Built-in mocking
  • βœ… No plugin dependencies

  • βœ… pytest-compatible

  • βœ… Crystal-clear errors
  • βœ… Markdown testing

Choose Your Path

Start from the beginning and learn testing fundamentals:

Get up to speed quickly:

Complete reference documentation:


Community & Contributing