From d8f0cc43705e95a3226b6697508aad4e6d171467 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Wed, 31 Jul 2024 20:20:14 -0500 Subject: [PATCH] Skip numpy conversion tests when using the numpy actx --- test/test_arraycontext.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py index 4bc1487..2d952fb 100644 --- a/test/test_arraycontext.py +++ b/test/test_arraycontext.py @@ -1171,16 +1171,17 @@ def test_numpy_conversion(actx_factory): assert np.allclose(ac.mass, ac_roundtrip.mass) assert np.allclose(ac.momentum[0], ac_roundtrip.momentum[0]) - from dataclasses import replace - ac_with_cl = replace(ac, enthalpy=ac_actx.mass) - with pytest.raises(TypeError): - actx.from_numpy(ac_with_cl) + if not isinstance(actx, NumpyArrayContext): + from dataclasses import replace + ac_with_cl = replace(ac, enthalpy=ac_actx.mass) + with pytest.raises(TypeError): + actx.from_numpy(ac_with_cl) - with pytest.raises(TypeError): - actx.from_numpy(ac_actx) + with pytest.raises(TypeError): + actx.from_numpy(ac_actx) - with pytest.raises(TypeError): - actx.to_numpy(ac) + with pytest.raises(TypeError): + actx.to_numpy(ac) # }}} -- GitLab