summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-08-06 17:57:39 (GMT)
committerGitHub <noreply@github.com>2021-08-06 17:57:39 (GMT)
commit8c07fef867707694c9f2fcee4d7a9563ad78ed14 (patch)
treeb684babd404ae0823384c62fe4fee881efdd16e7 /Lib/sqlite3
parent8c17db6cd4e29f922a195acdb5aff3ef9c2340e5 (diff)
downloadcpython-8c07fef867707694c9f2fcee4d7a9563ad78ed14.zip
cpython-8c07fef867707694c9f2fcee4d7a9563ad78ed14.tar.gz
cpython-8c07fef867707694c9f2fcee4d7a9563ad78ed14.tar.bz2
[3.9] bpo-43853: Handle sqlite3_value_text() errors (GH-25422). (GH-27627)
(cherry picked from commit 006fd869e4798b68e266f5de89c83ddb531a756b)
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/userfunctions.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py
index c11c82e..a1c29d4 100644
--- a/Lib/sqlite3/test/userfunctions.py
+++ b/Lib/sqlite3/test/userfunctions.py
@@ -236,9 +236,11 @@ class FunctionTests(unittest.TestCase):
def CheckParamString(self):
cur = self.con.cursor()
- cur.execute("select isstring(?)", ("foo",))
- val = cur.fetchone()[0]
- self.assertEqual(val, 1)
+ for text in ["foo", str()]:
+ with self.subTest(text=text):
+ cur.execute("select isstring(?)", (text,))
+ val = cur.fetchone()[0]
+ self.assertEqual(val, 1)
def CheckParamInt(self):
cur = self.con.cursor()
@@ -387,9 +389,9 @@ class AggregateTests(unittest.TestCase):
def CheckAggrCheckParamStr(self):
cur = self.con.cursor()
- cur.execute("select checkType('str', ?)", ("foo",))
+ cur.execute("select checkTypes('str', ?, ?)", ("foo", str()))
val = cur.fetchone()[0]
- self.assertEqual(val, 1)
+ self.assertEqual(val, 2)
def CheckAggrCheckParamInt(self):
cur = self.con.cursor()