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

Method test_cursor_isolation

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

Source from the content-addressed store, hash-verified

231 con.close()
232
233 def test_cursor_isolation(self):
234 con = self._connect()
235 try:
236 # Make sure cursors created from the same connection have
237 # the documented transaction isolation level
238 cur1 = con.cursor()
239 cur2 = con.cursor()
240 self.executeDDL1(cur1)
241 cur1.execute(
242 "insert into %sbooze values ('Victoria Bitter')" % (self.table_prefix)
243 )
244 cur2.execute("select name from %sbooze" % self.table_prefix)
245 booze = cur2.fetchall()
246 self.assertEqual(len(booze), 1)
247 self.assertEqual(len(booze[0]), 1)
248 self.assertEqual(booze[0][0], "Victoria Bitter")
249 finally:
250 con.close()
251
252 def test_description(self):
253 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