diff options
author | Gerhard Häring <gh@ghaering.de> | 2010-03-05 09:12:37 +0000 |
---|---|---|
committer | Gerhard Häring <gh@ghaering.de> | 2010-03-05 09:12:37 +0000 |
commit | 3bbb67273a8c146a38de91080a37e716e2699622 (patch) | |
tree | 19a3d1e79cb51cc42760af73724c4f4615d4c21c /Lib/sqlite3/test/transactions.py | |
parent | 2bb66e03b72ae5a0468dab0b7020316f31c8cfdf (diff) | |
download | cpython-git-3bbb67273a8c146a38de91080a37e716e2699622.tar.gz |
Merged code from pysqlite 2.6.0.
Diffstat (limited to 'Lib/sqlite3/test/transactions.py')
-rw-r--r-- | Lib/sqlite3/test/transactions.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/transactions.py b/Lib/sqlite3/test/transactions.py index c08b56f175..a732251b2d 100644 --- a/Lib/sqlite3/test/transactions.py +++ b/Lib/sqlite3/test/transactions.py @@ -148,6 +148,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, e: + pass + except: + self.fail("InterfaceError should have been raised") + class SpecialCommandTests(unittest.TestCase): def setUp(self): self.con = sqlite.connect(":memory:") |