本文整理匯總了Python中sqlite3.threadsafety方法的典型用法代碼示例。如果您正苦於以下問題:Python sqlite3.threadsafety方法的具體用法?Python sqlite3.threadsafety怎麽用?Python sqlite3.threadsafety使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sqlite3
的用法示例。
在下文中一共展示了sqlite3.threadsafety方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_basic_store
# 需要導入模塊: import sqlite3 [as 別名]
# 或者: from sqlite3 import threadsafety [as 別名]
def test_basic_store(self):
assert sqlite3.threadsafety == 1
blocks = bt.get_consecutive_blocks(test_constants, 9, [], 9, b"0")
blocks_alt = bt.get_consecutive_blocks(test_constants, 3, [], 9, b"1")
db = await SyncStore.create()
db_2 = await SyncStore.create()
# Save/get sync
for sync_mode in (False, True):
db.set_sync_mode(sync_mode)
assert sync_mode == db.get_sync_mode()
genesis = FullBlock.from_bytes(test_constants["GENESIS_BLOCK"])
# clear sync info
await db.clear_sync_info()
# add/get potential tip, get potential tips num
db.add_potential_tip(blocks[6])
assert blocks[6] == db.get_potential_tip(blocks[6].header_hash)
示例2: CheckThreadSafety
# 需要導入模塊: import sqlite3 [as 別名]
# 或者: from sqlite3 import threadsafety [as 別名]
def CheckThreadSafety(self):
self.assertEqual(sqlite.threadsafety, 1,
"threadsafety is %d, should be 1" % sqlite.threadsafety)
示例3: CheckThreadSafety
# 需要導入模塊: import sqlite3 [as 別名]
# 或者: from sqlite3 import threadsafety [as 別名]
def CheckThreadSafety(self):
self.assertEqual(sqlite.threadsafety, 1,
'threadsafety is %d, should be 1' % sqlite.threadsafety)