How to use the hunter.wrap function in hunter

To help you get started, we’ve selected a few hunter 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 ionelmc / python-hunter / tests / test_hunter.py View on Github external
    @hunter.wrap(actions=[snooper, CodePrinter(stream=lines)])
    def a():
        foo = bar = b = 1
        b = 2
        foo = 3
        foo = bar = 4
        return b
github ionelmc / python-hunter / tests / test_cookbook.py View on Github external
def brief_probe(qualname, *actions, **kwargs):
    return aspectlib.weave(qualname, functools.partial(hunter.wrap, actions=actions, **kwargs))
github ionelmc / python-hunter / tests / test_hunter.py View on Github external
    @hunter.wrap(local=True, action=lambda event: calls.append(
        '%06s calls=%s depth=%s %s' % (event.kind, event.calls, event.depth, event.fullsource)))
    def foo():
        bar()
        return 1
github ionelmc / python-hunter / tests / test_hunter.py View on Github external
    @hunter.wrap(action=lambda event: calls.append('%6r calls=%r depth=%r %s' % (event.kind, event.calls, event.depth, event.fullsource)))
    def foo():
        return 1