mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-118928: sqlite3: disallow sequences of params with named placeholders (#118929)
Follow-up of gh-101693. The previous DeprecationWarning is replaced with raising sqlite3.ProgrammingError. Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
7a97ee570f
commit
d8e0e00919
4 changed files with 10 additions and 8 deletions
|
@ -878,9 +878,8 @@ class CursorTests(unittest.TestCase):
|
|||
msg = "Binding.*is a named parameter"
|
||||
for query, params in dataset:
|
||||
with self.subTest(query=query, params=params):
|
||||
with self.assertWarnsRegex(DeprecationWarning, msg) as cm:
|
||||
with self.assertRaisesRegex(sqlite.ProgrammingError, msg) as cm:
|
||||
self.cu.execute(query, params)
|
||||
self.assertEqual(cm.filename, __file__)
|
||||
|
||||
def test_execute_indexed_nameless_params(self):
|
||||
# See gh-117995: "'?1' is considered a named placeholder"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue