def test_call_error_is_raised_with_correct_traceback():
    class A(object):
        @inject(x=str)
        def fun_a(self, x='irrelevant'):
            raise TypeError('Something happened')

    class B(object):
        @inject(a=A)
        def fun_b(self, a):
            a.fun_a()

    injector = Injector()
    b = injector.get(B)
    try:
        b.fun_b()
    except:
        tb = traceback.format_exc()
        assert 'in fun_a' in tb
dataset/ETHPy150Open alecthomas/injector/injector_test.py/test_call_error_is_raised_with_correct_traceback/original