From aedfe2eb101b64b80fded55b63913def62afff37 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 17 Jul 2025 23:56:27 +0200 Subject: [PATCH] Apply ruff/flake8-pytest-style rule PT031 PT031 `pytest.warns()` block should contain a single simple statement --- pyproject.toml | 1 - tests/test_api.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a4f15e268c..aca36eb9db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -325,7 +325,6 @@ ignore = [ "ANN401", "PT011", # TODO: apply this rule "PT030", # TODO: apply this rule - "PT031", # TODO: apply this rule "RET505", "RET506", "RUF005", diff --git a/tests/test_api.py b/tests/test_api.py index d9827c7e44..a552f13c6f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -436,7 +436,7 @@ def test_tree() -> None: g3.create_group("baz") g5 = g3.create_group("qux") g5.create_array("baz", shape=(100,), chunks=(10,), dtype="float64") - with pytest.warns(DeprecationWarning): + with pytest.warns(DeprecationWarning): # noqa: PT031 assert repr(zarr.tree(g1)) == repr(g1.tree()) assert str(zarr.tree(g1)) == str(g1.tree())