diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-06-04 18:54:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-04 18:54:39 (GMT) |
commit | 067d6d46575b5cf30bbf7c812defee1517106a34 (patch) | |
tree | 2497963d4b2a7ecfa831f8bd9c52465ee9aa3c67 /Lib | |
parent | 3f4d801bf907a5fcab50f3b64475d1410b90a80f (diff) | |
download | cpython-067d6d46575b5cf30bbf7c812defee1517106a34.zip cpython-067d6d46575b5cf30bbf7c812defee1517106a34.tar.gz cpython-067d6d46575b5cf30bbf7c812defee1517106a34.tar.bz2 |
bpo-43853: Handle sqlite3_value_text() errors (GH-25422)
(cherry picked from commit 006fd869e4798b68e266f5de89c83ddb531a756b)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/sqlite3/test/userfunctions.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py index 148d9f5..6f57d19 100644 --- a/Lib/sqlite3/test/userfunctions.py +++ b/Lib/sqlite3/test/userfunctions.py @@ -236,9 +236,11 @@ class FunctionTests(unittest.TestCase): def test_param_string(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 test_param_int(self): cur = self.con.cursor() @@ -391,9 +393,9 @@ class AggregateTests(unittest.TestCase): def test_aggr_check_param_str(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 test_aggr_check_param_int(self): cur = self.con.cursor() |