Python library for contracts testing
Project description
ycontract
Python library for contracts testing.
This library provides functions for precondition(prev_contract
) and postcondition(ret_contract
).
How to install
$ pip install ycontract
Example
Example files are here(test file)
Main example is
from ycontract import prev_contract, ret_contract
@prev_contract(lambda a, b: a * b > 0)
def add(a, b, c, d=2, e=3):
return a + b + c + d + e
@ret_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.1.9.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file ycontract-0.1.9.tar.gz
.
File metadata
- Download URL: ycontract-0.1.9.tar.gz
- Upload date:
- Size: 7.0 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 | 77d99fc91b3220951787bc3bd70243e2fe5c449604581ccc387df9c1523d0446 |
|
MD5 | 371ceea832e47d19107c3c93535ba534 |
|
BLAKE2b-256 | 00daa21d673c639ab66c42b12995679dd9dc09c86d63de7a33515c11df2ef398 |
File details
Details for the file ycontract-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: ycontract-0.1.9-py3-none-any.whl
- Upload date:
- Size: 7.1 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 | 53b522ff240a4da44213f568fa396abcf4b5e0bc2c1dbc216465eee9a0ad3b12 |
|
MD5 | 4a720b1908ffe763845b5e7bbbd89cb7 |
|
BLAKE2b-256 | b4cb42478e8aa4922db51ca6cb8e93c09bc0dd5d19a2c4fa854bab176be433ba |