Tryke - A Python testing tool
Project description
Tryke
Highlights
- 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
Getting started
For more information, see the documentation.
Write a test.
from typing import Annotated
import tryke as t
@t.fixture(per="scope")
def database():
db = {}
yield db
db.clear()
with t.describe("users"):
@t.fixture
def users(database: Annotated[dict[str, dict[str, str]], t.Depends(database)]):
database["users"] = {}
return database["users"]
with t.describe("get"):
@t.test("returns a stored user")
async def test_get(users: Annotated[dict[str, str], t.Depends(users)]):
users["alice"] = "alice@example.com"
t.expect(users["alice"], name="returns stored email").to_equal(
"alice@example.com"
)
with t.describe("set"):
@t.test("stores a new user")
async def test_set(users: Annotated[dict[str, str], t.Depends(users)]):
users["bob"] = "bob@example.com"
t.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 mode
Coming from pytest?
The migration guide has a side-by-side cheat sheet and a copy-paste LLM prompt.
License
This repository is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tryke-0.0.29-py3-none-win_amd64.whl.
File metadata
- Download URL: tryke-0.0.29-py3-none-win_amd64.whl
- Upload date:
- Size: 4.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39745f7d89060d4a94daf103cdf342fbd4c3d3166913951c496c060f06593b2b
|
|
| MD5 |
5f3b47d3cb3e06d391b084cd8d060148
|
|
| BLAKE2b-256 |
065361528e2ec84a7445b617d7fd7c88b9a0f03e759781d8b6b6bc3750d08f16
|
File details
Details for the file tryke-0.0.29-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tryke-0.0.29-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.1 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8aa1c8392db414a51ef5348d3ed604f274bcca9cf70b7e1b17fbdfc4bf1059bd
|
|
| MD5 |
98996f329394c45db1789fb06c3dee92
|
|
| BLAKE2b-256 |
1337475c32e87e0543b4ab8b861ec66236ca1c6fef63679c2ae571f3ec816deb
|
File details
Details for the file tryke-0.0.29-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: tryke-0.0.29-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
949d76447f0875175c40ebe4d56e43ab6e567194f19ff16d92e4902e24d23ba8
|
|
| MD5 |
5e377d13bcbdaca73182abd189082b79
|
|
| BLAKE2b-256 |
e7ba04bbd9220f3505176b75f30c09e4d03690a0dcf8b8c4304346cd5d007617
|