Skip to main content

tryke — python testing tool

Project description

tryke

A modern Python test runner, written in Rust.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tryke-0.0.5-py3-none-win_amd64.whl (3.7 MB view details)

Uploaded Python 3Windows x86-64

tryke-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tryke-0.0.5-py3-none-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file tryke-0.0.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: tryke-0.0.5-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

Hashes for tryke-0.0.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bdfd98604c755123449f46b7b57cd904eac28c26d28bbb6525de52437ebedf9f
MD5 164260c2a88f59cd0b70b71f170c2023
BLAKE2b-256 f4625153fb2e7cf08f7c77413dad4a193ecd8a69cc4cfc8c1bedf0011890a174

See more details on using hashes here.

File details

Details for the file tryke-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: tryke-0.0.5-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

Hashes for tryke-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc950bf107224e23066aee620e6ca5f5c5231e94bb90e857a395cf45ae08a024
MD5 c0b7e31f297b35677e9a2e7984467034
BLAKE2b-256 4ae2b55f4825b6f17d0e3b7ab46fc1126e37b50ffe1d34746cf30ebf1ac2037c

See more details on using hashes here.

File details

Details for the file tryke-0.0.5-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: tryke-0.0.5-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

Hashes for tryke-0.0.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f348c80e08971d5e34a621f12d799460d037bc6da2079cc6f8dbc0d5268f704
MD5 c6b28446bc57d9f1f410c511ef5de44d
BLAKE2b-256 3abcef67364316888afacdfd3a2b1db1e2288a95a9e76b2c7ec2ac21415bef13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page