Skip to content

Commit bd20e46

Browse files
Apply preview ruff rules (#1942)
* Apply ruff rule RUF022 RUF022 `__all__` is not sorted * Apply ruff rule RUF029 RUF029 Function is declared `async`, but doesn't `await` or use `async` features.
1 parent c2a1d2e commit bd20e46

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/zarr/codecs/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
__all__ = [
1313
"BatchedCodecPipeline",
14-
"BloscCodec",
1514
"BloscCname",
15+
"BloscCodec",
1616
"BloscShuffle",
1717
"BytesCodec",
18-
"Endian",
1918
"Crc32cCodec",
19+
"Endian",
2020
"GzipCodec",
2121
"ShardingCodec",
2222
"ShardingCodecIndexLocation",

tests/v3/test_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ async def test_asyncgroup_update_attributes(
368368

369369
@pytest.mark.parametrize("store", ("local", "memory"), indirect=["store"])
370370
@pytest.mark.parametrize("zarr_format", (2, 3))
371-
async def test_group_init(store: LocalStore | MemoryStore, zarr_format: ZarrFormat) -> None:
371+
def test_group_init(store: LocalStore | MemoryStore, zarr_format: ZarrFormat) -> None:
372372
agroup = sync(AsyncGroup.create(store=store, zarr_format=zarr_format))
373373
group = Group(agroup)
374374
assert group._async_group == agroup

tests/v3/test_sync.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import time
32
from collections.abc import AsyncGenerator
43
from unittest.mock import AsyncMock, patch
54

@@ -48,7 +47,7 @@ def test_sync_timeout() -> None:
4847
duration = 0.002
4948

5049
async def foo() -> None:
51-
time.sleep(duration)
50+
await asyncio.sleep(duration)
5251

5352
with pytest.raises(asyncio.TimeoutError):
5453
sync(foo(), timeout=duration / 2)

0 commit comments

Comments
 (0)