]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fixed support for test generators
authorNiko Wilbert <mail@nikowilbert.de>
Fri, 22 Aug 2014 08:48:42 +0000 (10:48 +0200)
committerBen Darnell <ben@bendarnell.com>
Sun, 24 Aug 2014 16:01:54 +0000 (12:01 -0400)
This fixes the problem that AsyncTestCase no longer seemed to work with test generators (as supported by Nose, http://nose.readthedocs.org/en/latest/writing_tests.html#test-generators).

tornado/testing.py

index b4bfb274a23350fd1f2c4b89c61a8601ddab96d3..6dd759b91c005c897fc2abcb1322591aa255dc97 100644 (file)
@@ -114,8 +114,8 @@ class _TestMethodWrapper(object):
     def __init__(self, orig_method):
         self.orig_method = orig_method
 
-    def __call__(self):
-        result = self.orig_method()
+    def __call__(self, *args, **kwargs):
+        result = self.orig_method(*args, **kwargs)
         if isinstance(result, types.GeneratorType):
             raise TypeError("Generator test methods should be decorated with "
                             "tornado.testing.gen_test")