tryke — python testing tool
Project description
tryke
a modern, delightful test framework for python
quickstart
# test_math.py
from tryke import expect, test
@test
def test_addition():
expect(1 + 1).to_equal(2)
uvx tryke test
features
- per-assertion diagnostic output
- concurrent test execution
- watch mode with live reload
- changed-files mode (only run tests affected by git changes)
- filter by name (
-k) or marker (-m) - multiple reporters: text, json, junit, dot, llm
- llm reporter with compact output
- native async test support
- client/server mode
expect API
expect(value).to_equal(other) # == equality
expect(value).to_be(other) # `is` identity
expect(value).to_contain(item) # `in` membership
expect(value).to_have_length(3) # len() check
expect(value).to_match(r"\d+") # regex search
expect(value).to_be_truthy() # bool(value) is True
expect(value).to_be_none() # value is None
expect(value).to_be_greater_than(0) # > comparison
expect(fn).to_raise(ValueError, match="bad input")
Negate any matcher with not_:
expect(result).not_.to_equal(0)
expect(items).not_.to_contain("secret")
Assertions are soft by default — multiple failures are collected
per test. Call .fatal() to stop immediately on failure:
expect(config).to_be_truthy().fatal() # stop here if None
expect(config["port"]).to_equal(8080) # only runs if above passed
test markers & tags
@test(name="addition works", tags=["fast"])
def test_add():
expect(1 + 1).to_equal(2)
@test.skip("flaky on CI")
def test_network(): ...
@test.skip_if(sys.platform == "win32", reason="unix only")
def test_permissions(): ...
@test.todo("not implemented yet")
def test_future_feature(): ...
@test.xfail("known upstream bug")
def test_broken_dep(): ...
@test
async def test_async_fetch():
result = await fetch_data()
expect(result).to_be_truthy()
CLI usage
tryke test # run all tests
tryke watch # re-run on file changes
tryke graph [--connected-only] # show import dependency graph
Key flags for test and watch:
-k FILTER filter by name ("math and not slow")
-m MARKERS filter by tag ("fast or unit")
--changed only tests affected by git changes
-x, --fail-fast stop after first failure
--maxfail N stop after N failures
-j N number of worker processes
--reporter FORMAT text | json | junit | dot | llm
--collect-only list discovered tests without running
-v / -vv / -q verbose / very verbose / quiet
install
uv add tryke
Or run directly without installing:
uvx tryke test
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.6-py3-none-win_amd64.whl.
File metadata
- Download URL: tryke-0.0.6-py3-none-win_amd64.whl
- Upload date:
- Size: 3.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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 |
823b87a477354cb46d4c81da4ec8281929b84197e4d2157ffbefcca1a47fd43a
|
|
| MD5 |
5261261341debf239a4108c64ca0dd2f
|
|
| BLAKE2b-256 |
b3325ffc599fe32c2e273c11cb3a42faf63781ae381888147da11cc2513c7734
|
File details
Details for the file tryke-0.0.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tryke-0.0.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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 |
46dfd966dab97c6fa112c5722bcac733045439a170481dc8dde7c62f5b7d8f5d
|
|
| MD5 |
82b3f61a6d7df1d35733b045ad19363b
|
|
| BLAKE2b-256 |
a1562906f78a61c43a81b6bf1a70a654ea6d12ac75e15c7140533497e87a288f
|
File details
Details for the file tryke-0.0.6-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: tryke-0.0.6-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.0 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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 |
4817b05a90b56155ea9bb01b00d0f97f2c17cd09f642c1f2b7792834c38e1765
|
|
| MD5 |
de87c7b01e435a4bda2b9f04ec0823f2
|
|
| BLAKE2b-256 |
495c868a72118937fcef311e10894ff00f0c006df42fdc2c16aeb0042cb153e9
|