@@ -94,14 +94,16 @@ def test_SSCursor(self):
9494 'executemany failed. cursor.rowcount != %s' % (str (len (self .data ))))
9595
9696 # Test multiple datasets
97- cursor .execute ('SELECT 1; SELECT 2; SELECT 3' )
97+ yield cursor .execute ('SELECT 1; SELECT 2; SELECT 3' )
9898 self .assertListEqual (list (cursor ), [(1 , )])
99- self .assertTrue (cursor .nextset ())
99+ res = yield cursor .nextset ()
100+ self .assertTrue (res )
100101 self .assertListEqual (list (cursor ), [(2 , )])
101- self .assertTrue (cursor .nextset ())
102+ res = yield cursor .nextset ()
103+ self .assertTrue (res )
102104 self .assertListEqual (list (cursor ), [(3 , )])
103- self . assertFalse ( cursor .nextset () )
104-
105+ res = yield cursor .nextset ()
106+ self . assertFalse ( res )
105107 finally :
106108 yield cursor .execute ('DROP TABLE tz_data' )
107109 yield cursor .close ()
@@ -126,6 +128,7 @@ def _cleanup(self):
126128 conn = self .connections [0 ]
127129 cursor = conn .cursor ()
128130 yield cursor .execute ('DROP TABLE IF EXISTS tz_data;' )
131+ yield cursor .close ()
129132
130133 @gen_test
131134 def test_sscursor_executemany (self ):
@@ -135,6 +138,7 @@ def test_sscursor_executemany(self):
135138 # Test executemany
136139 yield cursor .executemany (
137140 'INSERT INTO tz_data VALUES (%s, %s, %s)' , self .data )
141+ yield cursor ._close ()
138142 msg = 'executemany failed. cursor.rowcount != %s'
139143 self .assertEqual (cursor .rowcount , len (self .data ),
140144 msg % (str (len (self .data ))))
0 commit comments