MCPcopy Index your code
hub / github.com/RustPython/RustPython / setUp

Method setUp

Lib/test/test_sqlite3/test_transactions.py:184–195  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

182 """bpo-44092: sqlite3 now leaves it to SQLite to resolve rollback issues"""
183
184 def setUp(self):
185 self.con = sqlite.connect(":memory:")
186 self.cur1 = self.con.cursor()
187 self.cur2 = self.con.cursor()
188 with self.con:
189 self.con.execute("create table t(c)");
190 self.con.executemany("insert into t values(?)", [(0,), (1,), (2,)])
191 self.cur1.execute("begin transaction")
192 select = "select c from t"
193 self.cur1.execute(select)
194 self.con.rollback()
195 self.res = self.cur2.execute(select) # Reusing stmt from cache
196
197 def tearDown(self):
198 self.con.close()

Callers

nothing calls this directly

Calls 5

cursorMethod · 0.80
executemanyMethod · 0.80
rollbackMethod · 0.80
connectMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected