Skip to main content

Tryke - A Python testing tool

Project description

tryke-small

Tryke

ruff PyPI license python CI docs

Highlights

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


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

Uploaded Python 3Windows x86-64

tryke-0.0.29-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tryke-0.0.29-py3-none-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

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

Hashes for tryke-0.0.29-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 39745f7d89060d4a94daf103cdf342fbd4c3d3166913951c496c060f06593b2b
MD5 5f3b47d3cb3e06d391b084cd8d060148
BLAKE2b-256 065361528e2ec84a7445b617d7fd7c88b9a0f03e759781d8b6b6bc3750d08f16

See more details on using hashes here.

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

Hashes for tryke-0.0.29-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8aa1c8392db414a51ef5348d3ed604f274bcca9cf70b7e1b17fbdfc4bf1059bd
MD5 98996f329394c45db1789fb06c3dee92
BLAKE2b-256 1337475c32e87e0543b4ab8b861ec66236ca1c6fef63679c2ae571f3ec816deb

See more details on using hashes here.

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

Hashes for tryke-0.0.29-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 949d76447f0875175c40ebe4d56e43ab6e567194f19ff16d92e4902e24d23ba8
MD5 5e377d13bcbdaca73182abd189082b79
BLAKE2b-256 e7ba04bbd9220f3505176b75f30c09e4d03690a0dcf8b8c4304346cd5d007617

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