diff --git a/bugsnag/client.py b/bugsnag/client.py index dedf7b5f..f2a453de 100644 --- a/bugsnag/client.py +++ b/bugsnag/client.py @@ -117,7 +117,7 @@ def __call__(self, function): @wraps(function) def decorate(*args, **kwargs): with self: - function(*args, **kwargs) + return function(*args, **kwargs) return decorate diff --git a/tests/test_client.py b/tests/test_client.py index bf7977da..22e2440e 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -115,6 +115,14 @@ def foo(): self.assertSentReportCount(1) + def test_capture_decorator_returns_value(self): + + @self.client.capture + def foo(): + return "300" + + self.assertEqual(foo(), "300") + def test_capture_decorator_raises(self): @self.client.capture