# Oki.py
Minimal, typed, functional and dynamic test library.
## Usage
```py
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 :
![test suite output screenshot](https://git.barnulf.net/mb/okipy/media/branch/master/assets/output.png)
It is also possible to write inline tests :
```py
def add(a, b):
return a + b
@test()
def it_works(ctx):
pass
```
![test inline output screenshot](https://git.barnulf.net/mb/okipy/media/branch/master/assets/inline.png)
Raw data
{
"_id": null,
"home_page": null,
"name": "okipy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "test, functional, library, testing, dynamic, minimal",
"author": null,
"author_email": "Matthieu Jolimaitre <matthieu@imagevo.fr>",
"download_url": "https://files.pythonhosted.org/packages/0a/25/6f15dc242539d5ba9bf69936c890787deddf392692d302c27b46055d9e47/okipy-1.1.0.tar.gz",
"platform": null,
"description": "# Oki.py\n\nMinimal, typed, functional and dynamic test library.\n\n## Usage\n\n```py\ndef main():\n suite = Suite()\n\n @suite.test()\n def adds_correctly(ctx):\n assert 2 + 2 == 4\n\n @suite.test()\n def adds_incorrectly(ctx):\n print(\"this must work\")\n assert 2 + 2 == 5\n\n @suite.test()\n def it_doesnt_fail(ctx):\n print(\"hope this doesnt fail ...\")\n print(\"oh, this will fail\", file=sys.stderr)\n raise Exception(\"Expected failure.\")\n\n @suite.test()\n def it_fails(ctx):\n with ctx.assert_raises():\n raise Exception(\"Expected failure.\")\n\n suite.run()\n```\n\nResults in this output when run :\n\n![test suite output screenshot](https://git.barnulf.net/mb/okipy/media/branch/master/assets/output.png)\n\nIt is also possible to write inline tests :\n\n```py\n\ndef add(a, b):\n return a + b\n\n\n@test()\ndef it_works(ctx):\n pass\n\n```\n\n![test inline output screenshot](https://git.barnulf.net/mb/okipy/media/branch/master/assets/inline.png)\n",
"bugtrack_url": null,
"license": null,
"summary": "Minimal, typed, functional and dynamic test library.",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://git.barnulf.net/mb/okipy"
},
"split_keywords": [
"test",
" functional",
" library",
" testing",
" dynamic",
" minimal"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8fae076f6611d00dc36082b5e705fc70bdc510ca12f1d69f7b5de565dfcc0562",
"md5": "9d99344324d91e11794872867221afe0",
"sha256": "1d2b08a2b7c27563115f1b48a546f1a497ae6939d84e8e5dc44d09910cac59e6"
},
"downloads": -1,
"filename": "okipy-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9d99344324d91e11794872867221afe0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6134,
"upload_time": "2024-05-21T01:49:12",
"upload_time_iso_8601": "2024-05-21T01:49:12.837714Z",
"url": "https://files.pythonhosted.org/packages/8f/ae/076f6611d00dc36082b5e705fc70bdc510ca12f1d69f7b5de565dfcc0562/okipy-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0a256f15dc242539d5ba9bf69936c890787deddf392692d302c27b46055d9e47",
"md5": "58940b19e79e6d3d2f6107589aef18e0",
"sha256": "c78026c0928f36cac8aef6ea4c64390f80bca6275a0f80399ee96384183ee818"
},
"downloads": -1,
"filename": "okipy-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "58940b19e79e6d3d2f6107589aef18e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 5326,
"upload_time": "2024-05-21T01:49:13",
"upload_time_iso_8601": "2024-05-21T01:49:13.767404Z",
"url": "https://files.pythonhosted.org/packages/0a/25/6f15dc242539d5ba9bf69936c890787deddf392692d302c27b46055d9e47/okipy-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-21 01:49:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "okipy"
}