From cf8f33060e9bec79ee988546b85bc66e341971b5 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Fri, 28 Oct 2011 12:34:04 -0400
Subject: [PATCH] Skip test_image_2d if required image format not supported.

---
 test/test_wrapper.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/test_wrapper.py b/test/test_wrapper.py
index 32a4d0f4..f2b2a9b9 100644
--- a/test/test_wrapper.py
+++ b/test/test_wrapper.py
@@ -254,7 +254,15 @@ class TestCL:
             a = a[:,:,0]
 
         queue = cl.CommandQueue(context)
-        a_img = cl.image_from_array(context, a, num_channels)
+        try:
+            a_img = cl.image_from_array(context, a, num_channels)
+        except cl.RuntimeError, exc:
+            if exc.code == cl.status_code.IMAGE_FORMAT_NOT_SUPPORTED:
+                from py.test import skip
+                skip("required image format not supported on %s" % device.name)
+            else:
+                raise
+
         a_dest = cl.Buffer(context, cl.mem_flags.READ_WRITE, a.nbytes)
 
         samp = cl.Sampler(context, False,
-- 
GitLab