mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)
This commit is contained in:
parent
86d8b46523
commit
e34bb40919
1 changed files with 7 additions and 0 deletions
|
@ -880,6 +880,13 @@ class ExtensionTests(unittest.TestCase):
|
|||
with self.assertRaises(sqlite.DataError):
|
||||
cur.executescript("create table a(s);".ljust(size))
|
||||
|
||||
def test_cursor_executescript_tx_control(self):
|
||||
con = sqlite.connect(":memory:")
|
||||
con.execute("begin")
|
||||
self.assertTrue(con.in_transaction)
|
||||
con.executescript("select 1")
|
||||
self.assertFalse(con.in_transaction)
|
||||
|
||||
def test_connection_execute(self):
|
||||
con = sqlite.connect(":memory:")
|
||||
result = con.execute("select 5").fetchone()[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue