diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-06-26 01:16:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-26 01:16:24 (GMT) |
commit | c6a2320e876354ee62cf8149b849bcff9492d38a (patch) | |
tree | d5f5042334eb149bf08a01e7f09b429db0360ff2 /Lib/sqlite3/test | |
parent | ed076ed467264b43ed01a8223ca65b133b590919 (diff) | |
download | cpython-c6a2320e876354ee62cf8149b849bcff9492d38a.zip cpython-c6a2320e876354ee62cf8149b849bcff9492d38a.tar.gz cpython-c6a2320e876354ee62cf8149b849bcff9492d38a.tar.bz2 |
bpo-37406: sqlite3 raises TypeError for wrong operation type (GH-14386)
The sqlite3 module now raises TypeError, rather than ValueError, if
operation argument type is not str: execute(), executemany() and
calling a connection.
Diffstat (limited to 'Lib/sqlite3/test')
-rw-r--r-- | Lib/sqlite3/test/dbapi.py | 4 | ||||
-rw-r--r-- | Lib/sqlite3/test/regression.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 7c259d2..be11337 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -230,7 +230,7 @@ class CursorTests(unittest.TestCase): """) def CheckExecuteWrongSqlArg(self): - with self.assertRaises(ValueError): + with self.assertRaises(TypeError): self.cu.execute(42) def CheckExecuteArgInt(self): @@ -377,7 +377,7 @@ class CursorTests(unittest.TestCase): self.cu.executemany("insert into test(income) values (?)", mygen()) def CheckExecuteManyWrongSqlArg(self): - with self.assertRaises(ValueError): + with self.assertRaises(TypeError): self.cu.executemany(42, [(3,)]) def CheckExecuteManySelect(self): diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py index 865bd88..ee32616 100644 --- a/Lib/sqlite3/test/regression.py +++ b/Lib/sqlite3/test/regression.py @@ -261,7 +261,7 @@ class RegressionTests(unittest.TestCase): Call a connection with a non-string SQL request: check error handling of the statement constructor. """ - self.assertRaises(sqlite.Warning, self.con, 1) + self.assertRaises(TypeError, self.con, 1) def CheckCollation(self): def collation_cb(a, b): |