]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix run_with_stack_context test.
authorBen Darnell <ben@bendarnell.com>
Mon, 24 Jun 2013 23:39:25 +0000 (16:39 -0700)
committerBen Darnell <ben@bendarnell.com>
Mon, 24 Jun 2013 23:39:25 +0000 (16:39 -0700)
This test would never fail because it didn't check the result of its
Future.  Thanks to Florian Ludwig for pointing this out.

tornado/test/stack_context_test.py

index d6f8239e67c050d538301ce7674dd767b2c30c97..26988ddb351d2f2041b5f2bc18ccc13b6effcff6 100644 (file)
@@ -256,12 +256,13 @@ class StackContextTest(AsyncTestCase):
             self.io_loop.add_callback(cb)
         yield gen.Wait('k1')
 
+    @gen_test
     def test_run_with_stack_context(self):
         @gen.coroutine
         def f1():
             self.assertEqual(self.active_contexts, ['c1'])
             yield run_with_stack_context(
-                StackContext(functools.partial(self.context, 'c1')),
+                StackContext(functools.partial(self.context, 'c2')),
                 f2)
             self.assertEqual(self.active_contexts, ['c1'])
 
@@ -272,7 +273,7 @@ class StackContextTest(AsyncTestCase):
             self.assertEqual(self.active_contexts, ['c1', 'c2'])
 
         self.assertEqual(self.active_contexts, [])
-        run_with_stack_context(
+        yield run_with_stack_context(
             StackContext(functools.partial(self.context, 'c1')),
             f1)
         self.assertEqual(self.active_contexts, [])