summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sqlite3/test_userfunctions.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_sqlite3/test_userfunctions.py')
-rw-r--r--Lib/test/test_sqlite3/test_userfunctions.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_sqlite3/test_userfunctions.py b/Lib/test/test_sqlite3/test_userfunctions.py
index ad40847..62a11a5 100644
--- a/Lib/test/test_sqlite3/test_userfunctions.py
+++ b/Lib/test/test_sqlite3/test_userfunctions.py
@@ -31,6 +31,7 @@ import unittest.mock
import sqlite3 as sqlite
from test.support import bigmemtest
+from .test_dbapi import cx_limit
def with_tracebacks(strings, traceback=True):
@@ -223,6 +224,14 @@ class FunctionTests(unittest.TestCase):
with self.assertRaises(sqlite.OperationalError):
self.con.create_function("bla", -100, lambda x: 2*x)
+ def test_func_too_many_args(self):
+ category = sqlite.SQLITE_LIMIT_FUNCTION_ARG
+ msg = "too many arguments on function"
+ with cx_limit(self.con, category=category, limit=1):
+ self.con.execute("select abs(-1)");
+ with self.assertRaisesRegex(sqlite.OperationalError, msg):
+ self.con.execute("select max(1, 2)");
+
def test_func_ref_count(self):
def getfunc():
def f():