summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3/test/transactions.py
diff options
context:
space:
mode:
authorGerhard Häring <gh@ghaering.de>2010-03-05 15:20:03 (GMT)
committerGerhard Häring <gh@ghaering.de>2010-03-05 15:20:03 (GMT)
commitf9cee224461273307ca9f8a0e690a527496534ab (patch)
treec12745138703eba02cc59f892cf9f19db6cd7ff5 /Lib/sqlite3/test/transactions.py
parent06dbff3b1f16dc232df0190cfed4b3af81aecda3 (diff)
downloadcpython-f9cee224461273307ca9f8a0e690a527496534ab.zip
cpython-f9cee224461273307ca9f8a0e690a527496534ab.tar.gz
cpython-f9cee224461273307ca9f8a0e690a527496534ab.tar.bz2
Merged new pysqlite version 2.6.0 from trunk.
Diffstat (limited to 'Lib/sqlite3/test/transactions.py')
-rw-r--r--Lib/sqlite3/test/transactions.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/transactions.py b/Lib/sqlite3/test/transactions.py
index c9f6125..70e96a1 100644
--- a/Lib/sqlite3/test/transactions.py
+++ b/Lib/sqlite3/test/transactions.py
@@ -147,6 +147,26 @@ class TransactionTests(unittest.TestCase):
# NO self.con2.rollback() HERE!!!
self.con1.commit()
+ def CheckRollbackCursorConsistency(self):
+ """
+ Checks if cursors on the connection are set into a "reset" state
+ when a rollback is done on the connection.
+ """
+ con = sqlite.connect(":memory:")
+ cur = con.cursor()
+ cur.execute("create table test(x)")
+ cur.execute("insert into test(x) values (5)")
+ cur.execute("select 1 union select 2 union select 3")
+
+ con.rollback()
+ try:
+ cur.fetchall()
+ self.fail("InterfaceError should have been raised")
+ except sqlite.InterfaceError as e:
+ pass
+ except:
+ self.fail("InterfaceError should have been raised")
+
class SpecialCommandTests(unittest.TestCase):
def setUp(self):
self.con = sqlite.connect(":memory:")