From 15fbabbd3027ecde102df0f172b5b7e5e1f738b9 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 31 Jul 2024 17:07:31 -0500
Subject: [PATCH] Don't expect unflatten failure from numpy array for numpy
 actx

---
 test/test_arraycontext.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py
index 2d952fb..94d7d74 100644
--- a/test/test_arraycontext.py
+++ b/test/test_arraycontext.py
@@ -1113,9 +1113,10 @@ def test_flatten_array_container_failure(actx_factory):
     ary = _get_test_containers(actx, shapes=512)[0]
     flat_ary = _checked_flatten(ary, actx)
 
-    with pytest.raises(TypeError):
-        # cannot unflatten from a numpy array
-        unflatten(ary, actx.to_numpy(flat_ary), actx)
+    if not isinstance(actx, NumpyArrayContext):
+        with pytest.raises(TypeError):
+            # cannot unflatten from a numpy array (except for numpy actx)
+            unflatten(ary, actx.to_numpy(flat_ary), actx)
 
     with pytest.raises(ValueError):
         # cannot unflatten non-flat arrays
-- 
GitLab