aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_sqlite3/test_dbapi.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2025-05-08 15:42:00 +0300
committerGitHub <noreply@github.com>2025-05-08 15:42:00 +0300
commitdcf93c4c93b741e84fa75d2b0d00a156aaf07ecf (patch)
tree5e786ed1cccba7b4cc607e74588eeae752e4e636 /Lib/test/test_sqlite3/test_dbapi.py
parent2561e148ec985755baa3984b91fd0bfc089b283c (diff)
downloadcpython-dcf93c4c93b741e84fa75d2b0d00a156aaf07ecf.tar.gz
cpython-dcf93c4c93b741e84fa75d2b0d00a156aaf07ecf.zip
gh-133595: Clean up sqlite3.Connection APIs (GH-133605)
* All parameters of sqlite3.connect() except "database" are now keyword-only. * The first three parameters of methods create_function() and create_aggregate() are now positional-only. * The first parameter of methods set_authorizer(), set_progress_handler() and set_trace_callback() is now positional-only.
Diffstat (limited to 'Lib/test/test_sqlite3/test_dbapi.py')
-rw-r--r--Lib/test/test_sqlite3/test_dbapi.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py
index c3aa3bf2d7b..291e0356253 100644
--- a/Lib/test/test_sqlite3/test_dbapi.py
+++ b/Lib/test/test_sqlite3/test_dbapi.py
@@ -550,17 +550,9 @@ class ConnectionTests(unittest.TestCase):
cx.execute("insert into u values(0)")
def test_connect_positional_arguments(self):
- regex = (
- r"Passing more than 1 positional argument to sqlite3.connect\(\)"
- " is deprecated. Parameters 'timeout', 'detect_types', "
- "'isolation_level', 'check_same_thread', 'factory', "
- "'cached_statements' and 'uri' will become keyword-only "
- "parameters in Python 3.15."
- )
- with self.assertWarnsRegex(DeprecationWarning, regex) as cm:
- cx = sqlite.connect(":memory:", 1.0)
- cx.close()
- self.assertEqual(cm.filename, __file__)
+ with self.assertRaisesRegex(TypeError,
+ r'connect\(\) takes at most 1 positional arguments'):
+ sqlite.connect(":memory:", 1.0)
def test_connection_resource_warning(self):
with self.assertWarns(ResourceWarning):