Skip to main content

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


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.6-py3-none-win_amd64.whl (3.7 MB view details)

Uploaded Python 3Windows x86-64

tryke-0.0.6-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.6-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.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

Hashes for tryke-0.0.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 823b87a477354cb46d4c81da4ec8281929b84197e4d2157ffbefcca1a47fd43a
MD5 5261261341debf239a4108c64ca0dd2f
BLAKE2b-256 b3325ffc599fe32c2e273c11cb3a42faf63781ae381888147da11cc2513c7734

See more details on using hashes here.

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

Hashes for tryke-0.0.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 46dfd966dab97c6fa112c5722bcac733045439a170481dc8dde7c62f5b7d8f5d
MD5 82b3f61a6d7df1d35733b045ad19363b
BLAKE2b-256 a1562906f78a61c43a81b6bf1a70a654ea6d12ac75e15c7140533497e87a288f

See more details on using hashes here.

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

Hashes for tryke-0.0.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4817b05a90b56155ea9bb01b00d0f97f2c17cd09f642c1f2b7792834c38e1765
MD5 de87c7b01e435a4bda2b9f04ec0823f2
BLAKE2b-256 495c868a72118937fcef311e10894ff00f0c006df42fdc2c16aeb0042cb153e9

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