Python library for contracts testing
Project description
ycontract
Python library for contracts testing.
This library provides functions for checking argument(in_contract
) and return value(out_contract
) of a function.
How to install
$ pip install ycontract
Example
Example files are here(test file)
Main example is
from ycontract import in_contract, out_contract
@in_contract(lambda a, b: a * b > 0)
def add(a, b, c, d=2, e=3):
return a + b + c + d + e
@out_contract(lambda res: res > 0)
def sub(a, b):
return a - b
And if you want to be disable, call
ycontract.disable_contract()
LICENSES
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
ycontract-0.2.1.2.tar.gz
(7.3 kB
view hashes)
Built Distribution
Close
Hashes for ycontract-0.2.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2365ea5078988057ad8add81cffe9e9b2a0e8342ed22d2279a9fb846fb0758d3 |
|
MD5 | 4a7df0ecd893fe83a02d3f1775c793ea |
|
BLAKE2b-256 | 711a8cf4eb305463c0cd48a969590cec86abc4a608b01b1a173c08ad41e7481a |