How to use the icontract._checkers._walk_decorator_stack 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_checkers.py View on Github external
def test_with_single_decorator(self) -> None:
        @decorator_plus_1
        def func() -> int:
            return 0

        self.assertListEqual([1, 0], [a_func() for a_func in icontract._checkers._walk_decorator_stack(func)])
github Parquery / icontract / tests / test_checkers.py View on Github external
def test_with_double_decorator(self) -> None:
        @decorator_plus_2
        @decorator_plus_1
        def func() -> int:
            return 0

        self.assertListEqual([3, 1, 0], [a_func() for a_func in icontract._checkers._walk_decorator_stack(func)])
github Parquery / icontract / tests / test_checkers.py View on Github external
def test_wo_decorators(self) -> None:
        def func() -> int:
            return 0

        self.assertListEqual([0], [a_func() for a_func in icontract._checkers._walk_decorator_stack(func)])