How to use the deal.silent function in deal

To help you get started, we’ve selected a few deal 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 life4 / deal / tests / test_chain.py View on Github external
    @deal.chain(deal.silent, deal.offline)
    def func(msg, do):
        if msg:
            print(msg)
        if do:
            http = urllib3.PoolManager()
            http.request('GET', 'http://httpbin.org/robots.txt')
github life4 / deal / tests / test_imports.py View on Github external
def test_module_load():
    assert deal.activate()
    try:
        deal.module_load(deal.silent)
    finally:
        assert deactivate()

    with pytest.raises(RuntimeError):
        deal.module_load(deal.silent)
github life4 / deal / tests / test_aliases.py View on Github external
    @deal.silent()
    @deal.pure
    @deal.chain(deal.safe, deal.silent)
    def func(x: int) -> int:
        """docs were before docker
        """
        return x
github life4 / deal / tests / test_aliases.py View on Github external
    @deal.silent
    @deal.silent()
    @deal.pure
    @deal.chain(deal.safe, deal.silent)
    def func(x: int) -> int:
        """docs were before docker
        """
        return x
github life4 / deal / tests / test_aliases.py View on Github external
    @deal.chain(deal.safe, deal.silent)
    def func(x: int) -> int:
        """docs were before docker
        """
        return x
github life4 / deal / tests / test_imports.py View on Github external
    ('deal.silent', deal.silent),
    ('deal.silent()', deal.silent),
    ('deal.pre(something)', None),
    ('not_a_deal.silent', None),
    ('deal.typo', None),
])
def test_exec_contract(text, expected):
    tree = ast.parse(text)
    print(ast.dump(tree))
    actual = DealLoader._exec_contract(node=tree.body[0].value)
    assert actual == expected
github life4 / deal / tests / test_decorators / test_silent.py View on Github external
    @deal.silent
    async def func(msg):
        if msg:
            print(msg)
        return msg
github life4 / deal / tests.py View on Github external
        @deal.silent
        def func(msg):
            if msg:
                print(msg)
github life4 / deal / tests / test_decorators / test_silent.py View on Github external
    @deal.silent
    def func(msg):
        if msg:
            print(msg)
        yield msg
github life4 / deal / tests.py View on Github external
        @deal.chain(deal.silent, deal.offline)
        def func(msg, do):
            if msg:
                print(msg)
            if do:
                http = urllib3.PoolManager()
                http.request('GET', 'http://httpbin.org/robots.txt')