Skip to content

Commit

Permalink
Fix run_with_stack_context test.
Browse files Browse the repository at this point in the history
This test would never fail because it didn't check the result of its
Future.  Thanks to Florian Ludwig for pointing this out.
  • Loading branch information
bdarnell committed Jun 24, 2013
1 parent 913997e commit cb0dd06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tornado/test/stack_context_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@ def test_yield_outside_with_exception_stack_context(self):
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'])

Expand All @@ -272,7 +273,7 @@ def f2():
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, [])
Expand Down

0 comments on commit cb0dd06

Please sign in to comment.