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
Release history Release notifications | RSS feed
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.0.1.tar.gz
(4.9 kB
view details)
File details
Details for the file akane-1.0.1.tar.gz
.
File metadata
- Download URL: akane-1.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bfe2b69c7436a6f74750921c76353f9a6d1dad34baa10445566bb4ecd18b022 |
|
MD5 | 52dd5a9f95e7acfc8f6349005ff71ec2 |
|
BLAKE2b-256 | 01790c3b051e34dccdfa0e281383ecbe1a7bad70755a92b50b347ecb9a5b44d9 |