MCPcopy Index your code
hub / github.com/davispuh/MySQL-for-Python-3 / test_cursor_isolation

Method test_cursor_isolation

tests/dbapi20.py:249–266  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

247 con.close()
248
249 def test_cursor_isolation(self):
250 con = self._connect()
251 try:
252 # Make sure cursors created from the same connection have
253 # the documented transaction isolation level
254 cur1 = con.cursor()
255 cur2 = con.cursor()
256 self.executeDDL1(cur1)
257 cur1.execute("insert into %sbooze values ('Victoria Bitter')" % (
258 self.table_prefix
259 ))
260 cur2.execute("select name from %sbooze" % self.table_prefix)
261 booze = cur2.fetchall()
262 self.assertEqual(len(booze),1)
263 self.assertEqual(len(booze[0]),1)
264 self.assertEqual(booze[0][0],'Victoria Bitter')
265 finally:
266 con.close()
267
268 def test_description(self):
269 con = self._connect()

Callers

nothing calls this directly

Calls 6

_connectMethod · 0.95
executeDDL1Method · 0.95
cursorMethod · 0.80
executeMethod · 0.80
closeMethod · 0.80
fetchallMethod · 0.45

Tested by

no test coverage detected