allow more sqlite thread safety than the minimum we require (#14215)

https://docs.python.org/3.11/library/sqlite3.html#sqlite3.threadsafety

extracted from https://github.com/Chia-Network/chia-blockchain/pull/11407
This commit is contained in:
Kyle Altendorf 2022-12-23 12:34:10 -05:00 committed by GitHub
parent 3056db616c
commit 6e315e147a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ log = logging.getLogger(__name__)
@pytest.mark.asyncio
async def test_block_store(tmp_dir, db_version, bt):
assert sqlite3.threadsafety == 1
assert sqlite3.threadsafety >= 1
blocks = bt.get_consecutive_blocks(10)
async with DBConnection(db_version) as db_wrapper, DBConnection(db_version) as db_wrapper_2:
@ -282,7 +282,7 @@ async def test_get_generator(bt, db_version):
@pytest.mark.asyncio
async def test_get_blocks_by_hash(tmp_dir, bt, db_version):
assert sqlite3.threadsafety == 1
assert sqlite3.threadsafety >= 1
blocks = bt.get_consecutive_blocks(10)
async with DBConnection(db_version) as db_wrapper, DBConnection(db_version) as db_wrapper_2:
@ -320,7 +320,7 @@ async def test_get_blocks_by_hash(tmp_dir, bt, db_version):
@pytest.mark.asyncio
async def test_get_block_bytes_in_range(tmp_dir, bt, db_version):
assert sqlite3.threadsafety == 1
assert sqlite3.threadsafety >= 1
blocks = bt.get_consecutive_blocks(10)
async with DBConnection(db_version) as db_wrapper_2: