Skip to content

Commit c2c1d77

Browse files
committed
Don't expect unflatten failure from numpy array for numpy actx
1 parent 4699e96 commit c2c1d77

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/test_arraycontext.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,10 @@ def test_flatten_array_container_failure(actx_factory):
11131113
ary = _get_test_containers(actx, shapes=512)[0]
11141114
flat_ary = _checked_flatten(ary, actx)
11151115

1116-
with pytest.raises(TypeError):
1117-
# cannot unflatten from a numpy array
1118-
unflatten(ary, actx.to_numpy(flat_ary), actx)
1116+
if not isinstance(actx, NumpyArrayContext):
1117+
with pytest.raises(TypeError):
1118+
# cannot unflatten from a numpy array (except for numpy actx)
1119+
unflatten(ary, actx.to_numpy(flat_ary), actx)
11191120

11201121
with pytest.raises(ValueError):
11211122
# cannot unflatten non-flat arrays

0 commit comments

Comments
 (0)