mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-93057: Deprecate positional use of optional sqlite3.connect() params (#107948)
This commit is contained in:
parent
a482e5bf00
commit
13c36dc9ae
9 changed files with 92 additions and 5 deletions
|
|
@ -582,6 +582,19 @@ def test_connection_config(self):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue