8000 bpo-45243: Use connection limits to simplify `sqlite3` tests by erlend-aasland · Pull Request #29356 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
8000

bpo-45243: Use connection limits to simplify sqlite3 tests #29356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Make sure we test against correct limit in test_execute_too_many_params
  • Loading branch information
Erlend E. Aasland committed Nov 5, 2021
commit c257c65bccba60ca98f3c43f0940760567529463
5 changes: 3 additions & 2 deletions Lib/test/test_sqlite3/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,10 @@ 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 abs(?)", (-1,))
self.cu.execute("select * from test where id=?", (1,))
with self.assertRaisesRegex(sqlite.OperationalError, msg):
self.cu.execute("select max(?, ?)", (1, 2))
self.cu.execute("select * from test where id!=? and id!=?",
(1, 2))

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