Skip to content

Commit 28c2371

Browse files
zoola969Copilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent de03b02 commit 28c2371

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/test__storages.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,15 @@ def access_shared_resource(key: float) -> None:
131131

132132
# Create a thread pool executor to run tasks concurrently
133133
with ThreadPoolExecutor(max_workers=10) as executor:
134-
futures: list[Future[float]] = [
134+
futures: list[Future[None]] = [
135135
executor.submit(access_shared_resource, 0.1),
136136
executor.submit(access_shared_resource, 0.1),
137137
executor.submit(access_shared_resource, 0.01),
138138
executor.submit(access_shared_resource, 0.01),
139139
]
140140
# Wait for completion
141-
[future.result() for future in futures]
141+
for future in futures:
142+
future.result()
142143

143144
# we can see that waiting for key 0.1 does not block waiting for key 0.01
144145
assert [result.get() for _ in range(4)] == [0.01, 0.01, 0.1, 0.1], "Concurrent access did not work as expected"
@@ -147,7 +148,7 @@ def access_shared_resource(key: float) -> None:
147148

148149

149150
async def test__simple_lock__async__concurrent_access() -> None:
150-
"""Test SimpleLock in synchronous context with concurrent access."""
151+
"""Test SimpleLock in asynchronous context with concurrent access."""
151152
lock_storage = AsyncLockStorage()
152153
result = asyncio.Queue()
153154

0 commit comments

Comments
 (0)