mirror of
https://github.com/python/cpython.git
synced 2025-09-07 01:11:26 +00:00
bpo-45613: Set sqlite3.threadsafety
dynamically (GH-29227)
Use the compile-time selected default SQLite threaded mode to set the DB-API 2.0 attribute 'threadsafety' Mappings: - SQLITE_THREADSAFE=0 => threadsafety=0 - SQLITE_THREADSAFE=1 => threadsafety=3 - SQLITE_THREADSAFE=2 => threadsafety=1
This commit is contained in:
parent
762173c670
commit
c273986711
6 changed files with 72 additions and 18 deletions
|
@ -54,8 +54,9 @@ class ModuleTests(unittest.TestCase):
|
|||
"apilevel is %s, should be 2.0" % sqlite.apilevel)
|
||||
|
||||
def test_thread_safety(self):
|
||||
self.assertEqual(sqlite.threadsafety, 1,
|
||||
"threadsafety is %d, should be 1" % sqlite.threadsafety)
|
||||
self.assertIn(sqlite.threadsafety, {0, 1, 3},
|
||||
"threadsafety is %d, should be 0, 1 or 3" %
|
||||
sqlite.threadsafety)
|
||||
|
||||
def test_param_style(self):
|
||||
self.assertEqual(sqlite.paramstyle, "qmark",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue