aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_sqlite3/test_dbapi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_sqlite3/test_dbapi.py')
-rw-r--r--Lib/test/test_sqlite3/test_dbapi.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py
index 3f9bd0248a8..c9a9e135393 100644
--- a/Lib/test/test_sqlite3/test_dbapi.py
+++ b/Lib/test/test_sqlite3/test_dbapi.py
@@ -582,6 +582,19 @@ class ConnectionTests(unittest.TestCase):
with self.assertRaisesRegex(sqlite.IntegrityError, "constraint"):
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:
+ sqlite.connect(":memory:", 1.0)
+ self.assertEqual(cm.filename, __file__)
+
+
class UninitialisedConnectionTests(unittest.TestCase):
def setUp(self):