tryke.mp4
- Fast Rust-powered test discovery
- Concurrent tests by default
- Pretty, per-assertion diagnostics
- Soft assertions (like pytest-check)
- Native
asyncsupport — no plugin - Watch mode
- Changed mode (like pytest-picked)
- Client/server mode for fast editor integrations
- Fixtures with setup / teardown and typed
Depends()injection - Parametrized tests via
@test.cases - Grouping with
describe()blocks skip,skip_if,xfail, andtodomarkers- In-source testing
- Support for doctests
- Filtering and marks
- Reporters — text, dot, json, junit, llm, nextest-style, and pytest-sugar-style
Run tryke with uvx to get started quickly:
uvx trykeOr, check out the tryke playground to try it out in your browser.
To learn more about using tryke, see the documentation.
from typing import Annotated
from tryke import Depends, describe, expect, fixture, test
@fixture(per="scope")
def database():
db = {}
yield db
db.clear()
with describe("users"):
@fixture
def users(database: Annotated[dict[str, dict[str, str]], Depends(database)]):
database["users"] = {}
return database["users"]
with describe("get"):
@test("returns a stored user")
async def test_get(users: Annotated[dict[str, str], Depends(users)]):
users["alice"] = "alice@example.com"
expect(users["alice"], name="returns stored email").to_equal(
"alice@example.com"
)
with describe("set"):
@test("stores a new user")
async def test_set(users: Annotated[dict[str, str], Depends(users)]):
users["bob"] = "bob@example.com"
expect(users["bob"], name="stores email under user key").to_equal(
"bob@example.com"
)Run the tests:
uvx tryke test # run once
uvx tryke # watch modeThe migration guide has a side-by-side cheat sheet and a copy-paste LLM prompt.
This repository is licensed under the MIT License.