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 details)
Built Distribution
File details
Details for the file ycontract-0.2.1.2.tar.gz
.
File metadata
- Download URL: ycontract-0.2.1.2.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.7.0 Darwin/19.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4021ccab5663f1750c33c60236821d897fbb49dfa7fd59dce4d777af7e7921 |
|
MD5 | 56d4f1ea245ab3ca5ad0161c47244621 |
|
BLAKE2b-256 | 204502ec99a6ccbc4ce03f25340b30b30b23c5ca70d7a3860fbe47dd4e565cc4 |
File details
Details for the file ycontract-0.2.1.2-py3-none-any.whl
.
File metadata
- Download URL: ycontract-0.2.1.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.7.0 Darwin/19.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2365ea5078988057ad8add81cffe9e9b2a0e8342ed22d2279a9fb846fb0758d3 |
|
MD5 | 4a7df0ecd893fe83a02d3f1775c793ea |
|
BLAKE2b-256 | 711a8cf4eb305463c0cd48a969590cec86abc4a608b01b1a173c08ad41e7481a |