From 4f7caf13f9f6defa5aff6c43ea2813394cee3f4c Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 6 Sep 2024 19:13:39 +0200 Subject: [PATCH] Fix new ruff/flake8-type-checking TCH003 error TCH003 Move standard library import into a type-checking block --- tests/v3/test_buffer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/v3/test_buffer.py b/tests/v3/test_buffer.py index 06c0714333..5a313dc1ab 100644 --- a/tests/v3/test_buffer.py +++ b/tests/v3/test_buffer.py @@ -1,6 +1,6 @@ from __future__ import annotations -import types +from typing import TYPE_CHECKING import numpy as np import pytest @@ -23,6 +23,9 @@ ) from zarr.testing.utils import gpu_test +if TYPE_CHECKING: + import types + try: import cupy as cp except ImportError: