Skip to main content

Simple, stronly typed library to create tests for anything

Project description

akane

A very simple, strongly typed library to easily create test cases for anything.

Info
This project is mostly purpose built to create e2e integration tests for my CLI apps (like goup, for example). I wanted something lean which takes almost no effort to write tests with. Feel free to use it for your own projects, but don't expect a great developer experience.

If you are looking for proper testing libraries, feel free to take a look into the following resources.

Installation

pip install akane

or

pip install git+https://github.com/zekrotja/akane.git

Example

This example is also availble in the examples directory.

import os
import akane
from akane.assertions import assert_eq
from akane.procedures import setup, test, teardown


@setup()
def init_env_vars():
    os.environ["FOO"] = "bar"


@test(name="environment variables")
def test_env():
    assert_eq("bar", os.environ["FOO"])


@test(name="environment in shell")
def test_cmd():
    res = akane.exec(("sh", "-c", "echo $FOO"))
    assert_eq("bar\n", res)


@test(name="failing test")
def fails():
    return (False, "whoops")


@teardown(name="environment variables")
def delete_env_vars():
    del os.environ["FOO"]


def main() -> int:
    return akane.run_all()


if __name__ == "__main__":
    exit(main())

Project details


Download files

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

Source Distribution

akane-1.1.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file akane-1.1.0.tar.gz.

File metadata

  • Download URL: akane-1.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for akane-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1e587bee0af8dfb10d32e1528bd41e06e9bd7a2530d54c81f25edbf53165d4e4
MD5 feacf401c27b013ee54c0ae465277257
BLAKE2b-256 7a5fad700ef44a87e1e6c5bf854ed13d1cfa1ccf7a98e80b43fc12ec464f814b

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