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.
-
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:
- β
Drop-in compatible:
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:
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:
- Why Automated Testing? β Learn the fundamentals
- Your First Test β Get started in 5 minutes
- Testing Basics β Core concepts explained
- Making Tests Reusable β Introduction to fixtures
- Testing Multiple Cases β Parametrization made simple
- Organizing Your Tests β Structure and best practices
Get up to speed quickly:
- Feature Comparison β Complete feature compatibility table
- 5-Minute Migration β Get running in minutes
- Plugin Replacement Guide β Built-in alternatives to pytest plugins
- Coverage Integration β Simple coverage.py integration
- Known Limitations β What's not supported (yet)
Complete reference documentation:
- Writing Tests β Test functions, classes, and structure
- Fixtures β Complete fixtures reference
- Parametrization β Advanced parametrization techniques
- Marks & Filtering β Organizing and filtering tests
- Assertions β Assertion helpers and best practices
- CLI Reference β Command-line options
- API Reference β Complete API documentation
Community & Contributing¶
-
GitHub Repository
Star us, report issues, contribute code
-
Issue Tracker
Found a bug? Have a feature request?
-
Contributing Guide
Help make rustest even better
-
License
MIT License β Free and open source