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.1.tar.gz
(7.3 kB
view hashes)
Built Distribution
Close
Hashes for ycontract-0.2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43544c9a9d3053570a88c0430380a6e0b34847b06d8aca353ed3b7ff1c412e74 |
|
MD5 | 574fc77c25dc0cb590821d2d71191c94 |
|
BLAKE2b-256 | db60dc995366cba0efaa26981adb93b694b4b511c3655e35c063f8369d857d96 |