Minimal, typed, functional and dynamic test library.
Project description
Oki.py
Minimal, typed, functional and dynamic test library.
Usage
def main():
suite = Suite()
@suite.test()
def adds_correctly(ctx):
assert 2 + 2 == 4
@suite.test()
def adds_incorrectly(ctx):
print("this must work")
assert 2 + 2 == 5
@suite.test()
def it_doesnt_fail(ctx):
print("hope this doesnt fail ...")
print("oh, this will fail", file=sys.stderr)
raise Exception("Expected failure.")
@suite.test()
def it_fails(ctx):
with ctx.assert_raises():
raise Exception("Expected failure.")
suite.run()
Results in this output when run :
It is also possible to write inline tests :
def add(a, b):
return a + b
@test()
def it_works(ctx):
pass
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
okipy-1.2.0.tar.gz
(6.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
okipy-1.2.0-py3-none-any.whl
(7.0 kB
view details)
File details
Details for the file okipy-1.2.0.tar.gz.
File metadata
- Download URL: okipy-1.2.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
491ac47d33638c9a20db6731c22c6ef926f78938020c7e9d6da71cc24cc03c2e
|
|
| MD5 |
2dfd5596fd72499012d4085f38dd42d9
|
|
| BLAKE2b-256 |
488319960c6464ca7ab796006c0d0d52ded0ea710b1c3ed5947ce3c42fffb52b
|
File details
Details for the file okipy-1.2.0-py3-none-any.whl.
File metadata
- Download URL: okipy-1.2.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c52aecd8f5905337571879e0ed5d8b6e57a7f966daa5f2253db579dc867f022
|
|
| MD5 |
061d987081109a85a1fca1d68311aec5
|
|
| BLAKE2b-256 |
bd7576f2bad9ce585aec1c2db1614a7ace97878268b35355ba0d0292646ef2df
|