mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
[3.9] bpo-43853: Handle sqlite3_value_text() errors (GH-25422). (GH-27627)
(cherry picked from commit 006fd869e4
)
This commit is contained in:
parent
8c17db6cd4
commit
8c07fef867
3 changed files with 26 additions and 16 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue