diff --git a/tests.py b/tests.py index 26e2e3b..ca924b8 100644 --- a/tests.py +++ b/tests.py @@ -667,7 +667,7 @@ def test_request_queueing(self): self.run_parallel_queries(self.pool_size*2) def test_parallel_queries_after_reconnect_all(self): - """Testing that pool still queries database in parallel after ALL connections were closeded""" + """Testing that pool still queries database in parallel after ALL connections were closed""" self.shutter(self.db) self.run_parallel_queries() @@ -815,14 +815,20 @@ def test_abort_waiting_queue(self): @gen_test def test_execute_can_start_before_connection_is_done(self): db = momoko.Pool(dsn=self.good_dsn, size=1, ioloop=self.io_loop) - db.connect() + f = db.connect() cursor = yield db.execute("SELECT 1") self.assertEqual(cursor.fetchone()[0], 1) + # This is to hide tornado warnings about unconsumed futures + try: + yield f + except: + pass + @gen_test def test_execute_before_connection_is_done_will_error(self): db = momoko.Pool(dsn=bad_dsn, size=1, ioloop=self.io_loop) - db.connect() + f = db.connect() try: yield db.execute("SELECT 1") @@ -833,6 +839,12 @@ def test_execute_before_connection_is_done_will_error(self): except psycopg2.DatabaseError: pass + # This is to hide tornado warnings about unconsumed futures + try: + yield f + except: + pass + class MomokoPoolVolatileDbTestProxy(ProxyMixIn, MomokoPoolVolatileDbTest): @@ -869,15 +881,14 @@ def test_execute_can_fail_after_disconnect_with_no_reconnect(self): # No start proxy here! yield gen.sleep(db.reconnect_interval) f2 = db.execute("SELECT 1") - f3 = db.execute("SELECT 1") try: - yield [f2, f3] + yield f2 self.fail("Exception should have been raised") except psycopg2.DatabaseError: pass - self.assertEqual(len(db.conns.waiting_queue), 0) + self.assertEqual(len(db.conns.waiting_queue), 0) class MomokoPoolPartiallyConnectedTest(PoolBaseTest): raise_connect_errors = True