init
This commit is contained in:
commit
f4c09d21fe
18 changed files with 443 additions and 0 deletions
36
README.md
Normal file
36
README.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
# 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 :
|
||||
|
||||

|
Loading…
Add table
Add a link
Reference in a new issue