Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@eye
def __repr__(self):
return '%s(label=%r)' % (self.__class__.__name__, self.label)
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)())
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)())
def main():
call_id = eye._last_call_id
foo()
assert call_id is eye._last_call_id
@eye
def error():
raise ValueError()
@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')")
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
@eye
def use_gen_2(g):
for y in g:
print('bar', y)
@eye
def use_gen_1(g):
for x in islice(g, 3):
print('foo', x)
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