MCPcopy Index your code
hub / github.com/PyMySQL/mysqlclient / test_nextset

Method test_nextset

tests/test_MySQLdb_dbapi20.py:184–227  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

182 cur.execute("drop procedure deleteme")
183
184 def test_nextset(self):
185 # from warnings import warn
186
187 con = self._connect()
188 try:
189 cur = con.cursor()
190 if not hasattr(cur, "nextset"):
191 return
192
193 try:
194 self.executeDDL1(cur)
195 sql = self._populate()
196 for sql in self._populate():
197 cur.execute(sql)
198
199 self.help_nextset_setUp(cur)
200
201 cur.callproc("deleteme")
202 numberofrows = cur.fetchone()
203 assert numberofrows[0] == len(self.samples)
204 assert cur.nextset()
205 names = cur.fetchall()
206 assert len(names) == len(self.samples)
207 s = cur.nextset()
208 if s:
209 empty = cur.fetchall()
210 self.assertEqual(
211 len(empty), 0, "non-empty result set after other result sets"
212 )
213 # warn(
214 # ": ".join(
215 # [
216 # "Incompatibility",
217 # "MySQL returns an empty result set for the CALL itself"
218 # ]
219 # ),
220 # Warning,
221 # )
222 # assert s == None, "No more return sets, should return None"
223 finally:
224 self.help_nextset_tearDown(cur)
225
226 finally:
227 con.close()
228
229
230if __name__ == "__main__":

Callers

nothing calls this directly

Calls 12

help_nextset_setUpMethod · 0.95
help_nextset_tearDownMethod · 0.95
_connectMethod · 0.80
cursorMethod · 0.80
executeDDL1Method · 0.80
_populateMethod · 0.80
executeMethod · 0.80
callprocMethod · 0.80
nextsetMethod · 0.80
closeMethod · 0.80
fetchoneMethod · 0.45
fetchallMethod · 0.45

Tested by

no test coverage detected