From 9de73ccc2284db28a13726b5010cbbcd60e9ad58 Mon Sep 17 00:00:00 2001 From: uuuvn <83587632+uuuvn@users.noreply.github.com> Date: Wed, 23 Apr 2025 19:09:26 +0500 Subject: [PATCH] Skip test that requires python 3.12 on older versions (#10001) `out.cast(it.dtype.fmt).tolist()` fails with `ValueError: memoryview: destination format must be a native single character format prefixed with an optional '@'` --- test/test_image_dtype.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test_image_dtype.py b/test/test_image_dtype.py index 256bc4b0ba..c9d8d33676 100644 --- a/test/test_image_dtype.py +++ b/test/test_image_dtype.py @@ -1,6 +1,7 @@ import unittest import numpy as np from tinygrad import Device, dtypes, Tensor, Context +from tinygrad.device import is_dtype_supported from tinygrad.dtype import ImageDType from tinygrad.engine.realize import lower_schedule from tinygrad.helpers import prod, unwrap @@ -12,6 +13,8 @@ class TestImageCopy(unittest.TestCase): buf = it.lazydata.buffer out = buf.as_buffer() np.testing.assert_equal(out.cast(it.dtype.fmt).tolist(), np.arange(4)) + + @unittest.skipUnless(is_dtype_supported(dtypes.half, device="PYTHON"), "need half") def test_imageh_copyout_1x1(self): self.test_image_copyout_1x1(img_type=dtypes.imageh) def test_image_numpy_1x1(self, img_type=dtypes.imagef):