8000 gh-108278: Deprecate passing the three first params as keyword args for sqlite3 UDF creation APIs by erlend-aasland · Pull Request #108281 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108278: Deprecate passing the three first params as keyword args for sqlite3 UDF creation APIs #108281

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
Address review: inline tests
  • Loading branch information
erlend-aasland committed Aug 28, 2023
commit 15cf809c2526ccbab89761fb9e604628ecd1f08c
19 changes: 11 additions & 8 deletions Lib/test/test_sqlite3/test_userfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,17 +429,20 @@ def test_func_keyword_args(self):
r"positional-only in Python 3.15."
)

def check(*args, **kwds):
with self.assertWarnsRegex(DeprecationWarning, regex) as cm:
self.con.create_function(*args, **kwds)
self.assertEqual(cm.filename, __file__)

def noop():
return None

check("noop", 0, func=noop)
check("noop", narg=0, func=noop)
check(name="noop", narg=0, func=noop)
with self.assertWarnsRegex(DeprecationWarning, regex) as cm:
self.con.create_function("noop", 0, func=noop)
self.assertEqual(cm.filename, __file__)

with self.assertWarnsRegex(DeprecationWarning, regex) as cm:
self.con.create_function("noop", narg=0, func=noop)
self.assertEqual(cm.filename, __file__)

with self.assertWarnsRegex(DeprecationWarning, regex) as cm:
self.con.create_function(name="noop", narg=0, func=noop)
self.assertEqual(cm.filename, __file__)


class WindowSumInt:
Expand Down
0