Skip to main content

Tryke - A Python testing tool

Project description

tryke-small

Tryke

ruff PyPI license python CI docs

Highlights

Getting started

Run tryke with uvx to get started quickly:

uvx tryke

Or, check out the tryke playground to try it out in your browser.

To learn more about using tryke, see the documentation.

from typing import Annotated

from tryke import Depends, describe, expect, fixture, test


@fixture(per="scope")
def database():
    db = {}
    yield db
    db.clear()


with describe("users"):

    @fixture
    def users(database: Annotated[dict[str, dict[str, str]], Depends(database)]):
        database["users"] = {}

        return database["users"]

    with describe("get"):

        @test("returns a stored user")
        async def test_get(users: Annotated[dict[str, str], Depends(users)]):
            users["alice"] = "alice@example.com"

            expect(users["alice"], name="returns stored email").to_equal(
                "alice@example.com"
            )

    with describe("set"):

        @test("stores a new user")
        async def test_set(users: Annotated[dict[str, str], Depends(users)]):
            users["bob"] = "bob@example.com"

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

Uploaded Python 3Windows x86-64

tryke-0.0.30-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tryke-0.0.30-py3-none-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: tryke-0.0.30-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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.30-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b69c451bb656ae490e5d6aeea1362b00131bac516f1fb411e3b28c212cc92e67
MD5 daf8b40c599eddcecc96c4a70aae2a27
BLAKE2b-256 d1fc17368eab238139ff0f56e0c2864d5bb7ec28ef251fe87d165fbe90fb54e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tryke-0.0.30-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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.30-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 91b26eccfb33bf39323566a351e6039cf526093ee53d44b73a7e5796c46aa22b
MD5 a88e5a6b8411852e2e9980f29d7aa1a3
BLAKE2b-256 cc2c6a2b8f25f1a73a744fdd258b2b29d9751458286a456e2daa7b9757d3e8b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tryke-0.0.30-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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.30-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9a9777eaab5a37c5736000f2195fc01365e0317485e9a819c301a714c74f7055
MD5 5eeffe7e7d0103d46923a648c81eceb8
BLAKE2b-256 426afa4d3639e2d95c3bc4f1974841a5de6cd348cfbe2a1376addc32e3212de9

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