Skip to content
Merged
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
Erlend E. Aasland committed Nov 2, 2021
commit cb5624974e5567900eb2d6fa20d66e53ac733d21
7 changes: 5 additions & 2 deletions Lib/test/test_sqlite3/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,12 @@ def __getitem__(slf, x):
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):
with cx_limit(self.cx, category=category, limit=2):
self.cu.execute("select * from test where name=? and income=?",
("a", 1))
with self.assertRaisesRegex(sqlite.OperationalError, msg):
self.cu.execute("insert into test values(?, ?)", (1, 2))
self.cu.execute("insert into test values(?, ?, ?)",
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
("a", 2, "b"))

def test_execute_dict_mapping(self):
self.cu.execute("insert into test(name) values ('foo')")
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_sqlite3/test_userfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ def test_func_too_many_args(self):
msg = "too many arguments on function"
with cx_limit(self.con, category=category, limit=1):
with self.assertRaisesRegex(sqlite.OperationalError, msg):
self.con.create_function("toomany", 2, lambda: "")
self.con.execute("select toomany(1, 2)");
self.con.create_function("addint", 2, lambda x, y: x+y)
self.con.execute("select addint(1, 2)");

def test_func_ref_count(self):
def getfunc():
Expand Down