Rtest: Python test runner built in Rust

0.0.46 · active · verified Sat Apr 11

Rtest is a high-performance Python test runner built in Rust. It replaces traditional import-heavy test collection with static Abstract Syntax Tree (AST) analysis, significantly speeding up test discovery, especially in large monorepos. Currently in early development (v0.0.x), it aims for `pytest` compatibility while offering performance gains and parallel test execution.

Warnings

Install

Imports

Quickstart

Create a test file (e.g., `my_tests/test_example.py`) with standard Python test functions. Run `rtest` from your terminal, pointing it to your test directory or files. Rtest will discover and execute the tests.

# my_tests/test_example.py
def test_addition():
    assert 1 + 1 == 2

def test_failing_example():
    assert 'hello'.upper() == 'HELLO'

# To run these tests from your terminal:
# Navigate to your project root (e.g., one level above my_tests)
# $ pip install rtest
# $ rtest my_tests

# Example with a specific rtest utility:
# from rtest import raises
#
# def test_raises_exception():
#     with raises(ValueError, match='invalid literal'):
#         int('abc')

view raw JSON →