summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3/test/dbapi.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-06-12 10:42:12 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-06-12 10:42:12 (GMT)
commit96471105f4b4911961527ed616fd58056f24c685 (patch)
tree712e20a29778e6733f5bdabf4c80e9ed06d957f2 /Lib/sqlite3/test/dbapi.py
parent89f27e5888af782ed70d5a4040545872cdd093a7 (diff)
parentc415440faa67c488fd2a5d8fc0977cbd660c4a90 (diff)
downloadcpython-96471105f4b4911961527ed616fd58056f24c685.zip
cpython-96471105f4b4911961527ed616fd58056f24c685.tar.gz
cpython-96471105f4b4911961527ed616fd58056f24c685.tar.bz2
Issue #27188: Merge from 3.5
Diffstat (limited to 'Lib/sqlite3/test/dbapi.py')
-rw-r--r--Lib/sqlite3/test/dbapi.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 04649fc..04d0479 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -250,6 +250,11 @@ class CursorTests(unittest.TestCase):
row = self.cu.fetchone()
self.assertEqual(row[0], "Hu\x00go")
+ def CheckExecuteNonIterable(self):
+ with self.assertRaises(ValueError) as cm:
+ self.cu.execute("insert into test(id) values (?)", 42)
+ self.assertEqual(str(cm.exception), 'parameters are of unsupported type')
+
def CheckExecuteWrongNoOfArgs1(self):
# too many parameters
try:
@@ -725,6 +730,13 @@ class ExtensionTests(unittest.TestCase):
raised = True
self.assertEqual(raised, True, "should have raised an exception")
+ def CheckCursorExecutescriptAsBytes(self):
+ con = sqlite.connect(":memory:")
+ cur = con.cursor()
+ with self.assertRaises(ValueError) as cm:
+ cur.executescript(b"create table test(foo); insert into test(foo) values (5);")
+ self.assertEqual(str(cm.exception), 'script argument must be unicode.')
+
def CheckConnectionExecute(self):
con = sqlite.connect(":memory:")
result = con.execute("select 5").fetchone()[0]