How to use the icontract.require function in icontract

To help you get started, we’ve selected a few icontract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Parquery / icontract / tests / test_inheritance_precondition.py View on Github external
            @icontract.require(lambda x: x % 2 == 0)
            def func(self, x: int) -> None:
                pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_10_disabled_contracts.py View on Github external
@icontract.require(lambda x: x > 4, enabled=False)
@icontract.require(lambda x: x > 5, enabled=False)
@icontract.require(lambda x: x > 6, enabled=False)
@icontract.require(lambda x: x > 7, enabled=False)
@icontract.require(lambda x: x > 8, enabled=False)
@icontract.require(lambda x: x > 9, enabled=False)
def some_func72(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_5_contracts.py View on Github external
@icontract.require(lambda x: x > 2)
@icontract.require(lambda x: x > 3)
@icontract.require(lambda x: x > 4)
def some_func90(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_5_contracts.py View on Github external
@icontract.require(lambda x: x > 3)
@icontract.require(lambda x: x > 4)
def some_func83(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_1_disabled_contract.py View on Github external
@icontract.require(lambda x: x > 0, enabled=False)
def some_func43(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_1_contract.py View on Github external
@icontract.require(lambda x: x > 0)
def some_func98(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_5_contracts.py View on Github external
@icontract.require(lambda x: x > 2)
@icontract.require(lambda x: x > 3)
@icontract.require(lambda x: x > 4)
def some_func63(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_5_contracts.py View on Github external
@icontract.require(lambda x: x > 4)
def some_func61(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_5_disabled_contracts.py View on Github external
@icontract.require(lambda x: x > 2, enabled=False)
@icontract.require(lambda x: x > 3, enabled=False)
@icontract.require(lambda x: x > 4, enabled=False)
def some_func23(x: int) -> None:
    pass
github Parquery / icontract / benchmarks / import_cost / functions_100_with_10_contracts.py View on Github external
@icontract.require(lambda x: x > 0)
@icontract.require(lambda x: x > 1)
@icontract.require(lambda x: x > 2)
@icontract.require(lambda x: x > 3)
@icontract.require(lambda x: x > 4)
@icontract.require(lambda x: x > 5)
@icontract.require(lambda x: x > 6)
@icontract.require(lambda x: x > 7)
@icontract.require(lambda x: x > 8)
@icontract.require(lambda x: x > 9)
def some_func25(x: int) -> None:
    pass