Skip to content

Commit 442bc4e

Browse files
tanbroclaude
andcommitted
test(tests): add MSSQL support to test_many_bytes_key
MSSQL sp_getapplock uses string lock names, so bytes keys can be encoded as hex strings and used as lock identifiers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1396e42 commit 442bc4e

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

tests/asyncio/test_basic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ async def test_many_bytes_key(self):
8585
key = token_hex().encode()
8686
elif engine.name == "postgresql":
8787
key = token_bytes()
88+
elif engine.name == "mssql":
89+
# MSSQL sp_getapplock uses string lock names
90+
key = token_hex().encode()
8891
else:
8992
raise NotImplementedError()
9093
async with create_async_sadlock(conn, key) as lock:

tests/test_basic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ def test_many_bytes_key(self):
7575
key = token_hex().encode()
7676
elif engine.name == "postgresql":
7777
key = token_bytes()
78+
elif engine.name == "mssql":
79+
# MSSQL sp_getapplock uses string lock names
80+
key = token_hex().encode()
7881
else:
7982
raise NotImplementedError()
8083
with create_sadlock(conn, key) as lock:

0 commit comments

Comments
 (0)