]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix test; cleanup whitespace.
authorBen Darnell <ben@bendarnell.com>
Sun, 18 Jan 2015 21:33:11 +0000 (16:33 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 18 Jan 2015 21:33:11 +0000 (16:33 -0500)
tornado/gen.py
tornado/test/gen_test.py

index 0f5e134ae18b0e7573a3d20cdac87a43b46761f1..2ec48dfb461bea19ae94a2239374087a6504bfc8 100644 (file)
@@ -287,14 +287,13 @@ class WaitIterator(object):
             for k, v in kwargs.items():
                 self._keys.append(k)
                 self._futures.append(v)
-            
         else:
             self._keys = None
             self._futures = list(args)
-            
+
         self._queue = collections.deque()
         self._current_future = None
-        
+
         for future in self._futures:
             if future.done():
                 self._queue.append(future)
@@ -326,7 +325,7 @@ class WaitIterator(object):
             pass
 
         return self._running_future
-    
+
     def current_index(self):
         """Returns the index of the current `.Future` from the
         argument list. If keyword arguments were used, the keyword
@@ -334,7 +333,7 @@ class WaitIterator(object):
         """
         if self._current_future:
             return self._current_future[0]
-            
+
     def current_future(self):
         """Returns the current `.Future` object."""
         if self._current_future:
@@ -362,10 +361,10 @@ class WaitIterator(object):
         index = self._futures.index(done)
         ## Eliminate the reference for GC
         self._futures[index] = None
-        
+
         if self._keys:
             index = self._keys[index]
-        
+
         self._current_future = (index, done)
 
 class YieldPoint(object):
index 270fc45893908e27d4e682086f6a387c59f021a9..692552f976c72c44906cb5cb4eea7404b9dd266e 100644 (file)
@@ -1091,7 +1091,7 @@ class WaitIteratorTest(AsyncTestCase):
         f1.set_result(24)
         f2.set_result(42)
         f3.set_result(84)
-        
+
         g = gen.WaitIterator(f1, f2, f3)
         i = 0
         for f in g:
@@ -1114,7 +1114,7 @@ class WaitIteratorTest(AsyncTestCase):
         self.assertEqual(g.current_future(), None, "bad nil current future")
 
         dg = gen.WaitIterator(f1=f1, f2=f2)
-                        
+
         for df in dg:
             dr = yield df
             if dg.current_index() == "f1":
@@ -1136,7 +1136,7 @@ class WaitIteratorTest(AsyncTestCase):
         if iteration == 3:
             futures[2].set_result(24)
         elif iteration == 5:
-            futures[0].set_exception(ZeroDivisionError)
+            futures[0].set_exception(ZeroDivisionError())
         elif iteration == 8:
             futures[1].set_result(42)
             futures[3].set_result(84)
@@ -1147,7 +1147,7 @@ class WaitIteratorTest(AsyncTestCase):
     @gen_test
     def test_iterator(self):
         futures = [Future(), Future(), Future(), Future()]
-        
+
         self.finish_coroutines(0, futures)
 
         g = gen.WaitIterator(*futures)