Index: Lib/sqlite3/test/dbapi.py =================================================================== --- Lib/sqlite3/test/dbapi.py (revision 81524) +++ Lib/sqlite3/test/dbapi.py (working copy) @@ -49,7 +49,7 @@ def CheckError(self): self.assertTrue(issubclass(sqlite.Error, Exception), "Error is not a subclass of Exception") - + def CheckInterfaceError(self): self.assertTrue(issubclass(sqlite.InterfaceError, sqlite.Error), "InterfaceError is not a subclass of Error") @@ -90,6 +90,22 @@ cu.execute("create table test(id integer primary key, name text)") cu.execute("insert into test(name) values (?)", ("foo",)) + + def CheckTransaction(self): + + self.cx = sqlite.connect(":memory:") + cu = self.cx.cursor() + self.assertEqual(self.cx.in_transaction, False) + cu.execute("create table transactiontest(id integer primary key, name text)") + self.assertEqual(self.cx.in_transaction, False) + cu.execute("insert into transactiontest(name) values (?)", ("foo",)) + self.assertEqual(self.cx.in_transaction, True) + self.cx.commit() + self.assertEqual(self.cx.in_transaction, False) + cu.execute("select name from transactiontest where name=?", ["foo"]) + row = cu.fetchone() + self.assertEqual(self.cx.in_transaction, False) + def tearDown(self): self.cx.close()