Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Simplify sql statements in test_execute_too_many_params
  • Loading branch information
Erlend E. Aasland committed Nov 5, 2021
commit 6197b3a8ab5e9834ca0efb86d0b1beddc4d1ab7f
5 changes: 2 additions & 3 deletions Lib/test/test_sqlite3/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,9 @@ def test_execute_too_many_params(self):
category = sqlite.SQLITE_LIMIT_VARIABLE_NUMBER
msg = "too many SQL variables"
with cx_limit(self.cx, category=category, limit=1):
self.cu.execute("select * from test where name=?", ("a",))
self.cu.execute("select round(?)", (1.1,))
with self.assertRaisesRegex(sqlite.OperationalError, msg):
self.cu.execute("select * from test where name=? and income=?",
("a", 1))
self.cu.execute("select max(?, ?)", (1, 2))

def test_execute_dict_mapping(self):
self.cu.execute("insert into test(name) values ('foo')")
Expand Down