How to use the birdseye.eye function in birdseye

To help you get started, we’ve selected a few birdseye 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 alexmojaki / birdseye / tests / test_birdseye.py View on Github external
            @eye
            def __repr__(self):
                return '%s(label=%r)' % (self.__class__.__name__, self.label)
github alexmojaki / birdseye / tests / test_birdseye.py View on Github external
def test_future_imports(self):
        from tests.future_tests import with_future, without_future
        self.assertEqual(with_future.foo(), eye(with_future.foo)())
        self.assertEqual(without_future.foo(), eye(without_future.foo)())
github alexmojaki / birdseye / tests / test_birdseye.py View on Github external
def test_future_imports(self):
        from tests.future_tests import with_future, without_future
        self.assertEqual(with_future.foo(), eye(with_future.foo)())
        self.assertEqual(without_future.foo(), eye(without_future.foo)())
github alexmojaki / snoop / tests / samples / enabled.py View on Github external
def main():
    call_id = eye._last_call_id
    foo()
    assert call_id is eye._last_call_id
github alexmojaki / birdseye / tests / test_birdseye.py View on Github external
        @eye
        def test_A():
            self.assertEqual(a.label, 'hello')
            self.assertEqual(a.length, 3)
            self.assertEqual(a.thing, 'thing')
            self.assertEqual(repr(a), "A(label='hello')")
github alexmojaki / executing / tests / samples / tracer2.py View on Github external
def _trace(self, func, *args, **kwargs):
        # noinspection PyUnresolvedReferences
        from birdseye import eye

        traced = eye(func)
        traced = self.config.snoop(*args, **kwargs)(traced)

        @functools.wraps(func)
        def wrapper(*func_args, **func_kwargs):
            if self.config.enabled:
                final_func = traced
            else:
                final_func = func

            return final_func(*func_args, **func_kwargs)

        return wrapper
github alexmojaki / birdseye / example_usage.py View on Github external
@eye
def use_gen_2(g):
    for y in g:
        print('bar', y)
github alexmojaki / birdseye / example_usage.py View on Github external
@eye
def use_gen_1(g):
    for x in islice(g, 3):
        print('foo', x)
github alexmojaki / snoop / snoop / tracer.py View on Github external
def _trace(self, func, *args, **kwargs):
        # noinspection PyUnresolvedReferences
        from birdseye import eye

        traced = eye(func)
        traced = self.config.snoop(*args, **kwargs)(traced)

        @functools.wraps(func)
        def wrapper(*func_args, **func_kwargs):
            if self.config.enabled:
                final_func = traced
            else:
                final_func = func

            return final_func(*func_args, **func_kwargs)

        return wrapper