Skip to content

Commit

Permalink
Apply preview ruff rules (#1942)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
DimitriPapadopoulos authored Jun 2, 2024
1 parent c2a1d2e commit bd20e46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/zarr/codecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

__all__ = [
"BatchedCodecPipeline",
"BloscCodec",
"BloscCname",
"BloscCodec",
"BloscShuffle",
"BytesCodec",
"Endian",
"Crc32cCodec",
"Endian",
"GzipCodec",
"ShardingCodec",
"ShardingCodecIndexLocation",
Expand Down
2 changes: 1 addition & 1 deletion tests/v3/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ async def test_asyncgroup_update_attributes(

@pytest.mark.parametrize("store", ("local", "memory"), indirect=["store"])
@pytest.mark.parametrize("zarr_format", (2, 3))
async def test_group_init(store: LocalStore | MemoryStore, zarr_format: ZarrFormat) -> None:
def test_group_init(store: LocalStore | MemoryStore, zarr_format: ZarrFormat) -> None:
agroup = sync(AsyncGroup.create(store=store, zarr_format=zarr_format))
group = Group(agroup)
assert group._async_group == agroup
3 changes: 1 addition & 2 deletions tests/v3/test_sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import time
from collections.abc import AsyncGenerator
from unittest.mock import AsyncMock, patch

Expand Down Expand Up @@ -48,7 +47,7 @@ def test_sync_timeout() -> None:
duration = 0.002

async def foo() -> None:
time.sleep(duration)
await asyncio.sleep(duration)

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

0 comments on commit bd20e46

Please sign in to comment.