MCPcopy
hub / github.com/psycopg/psycopg / test_cursor_isolation

Method test_cursor_isolation

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

Source from the content-addressed store, hash-verified

261 con.close()
262
263 def test_cursor_isolation(self):
264 con = self._connect()
265 try:
266 # Make sure cursors created from the same connection have
267 # the documented transaction isolation level
268 cur1 = con.cursor()
269 cur2 = con.cursor()
270 self.executeDDL1(cur1)
271 cur1.execute("insert into %sbooze values ('Victoria Bitter')" % (
272 self.table_prefix
273 ))
274 cur2.execute("select name from %sbooze" % self.table_prefix)
275 booze = cur2.fetchall()
276 self.assertEqual(len(booze),1)
277 self.assertEqual(len(booze[0]),1)
278 self.assertEqual(booze[0][0],'Victoria Bitter')
279 finally:
280 con.close()
281
282 def test_description(self):
283 con = self._connect()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected