Skip to content

Timed decorator doesn't return wrapped function result #602

merged 1 commit into from Jan 18, 2013

2 participants


The timed decorator should return the result of the function it wraps, but it provides None thus breaking functionality.

This type of code breaks:


Can you add a test? How about this:

diff --git a/unit_tests/ b/unit_tests/
index 4dadc02..2a6451c 100644
--- a/unit_tests/
+++ b/unit_tests/
@@ -88,6 +88,12 @@ class TestTools(unittest.TestCase):
         quick = timed(.2)(quick)

+        def check_result():
+            return 42
+        check_result = timed(.2)(check_result)
+        assert 42 == check_result()

Added in the test. Amended existing commit message.


LGTM! Thank you!

@jszakmeister jszakmeister merged commit 92b8f96 into nose-devs:master Jan 18, 2013

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.