From e33c171ac0f359860e9d85f45fef6b617053c1f6 Mon Sep 17 00:00:00 2001
From: Matthias Diener <mdiener@illinois.edu>
Date: Thu, 10 Jun 2021 17:11:16 -0500
Subject: [PATCH] fix(?) test_container_arithmetic

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

diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py
index b04f9ec..cd4b427 100644
--- a/test/test_arraycontext.py
+++ b/test/test_arraycontext.py
@@ -604,7 +604,9 @@ def test_container_arithmetic(actx_factory):
     bcast_result = ary_dof + bcast_dc_of_dofs
     bcast_dc_of_dofs + ary_dof
 
-    assert actx.np.linalg.norm(bcast_result.mass - 2*ary_of_dofs) < 1e-8
+    res = bcast_result.mass - 2*ary_of_dofs
+
+    assert np.linalg.norm(actx.to_numpy(res[0][0]) < 1e-8)
 
     mock_gradient = MyContainerDOFBcast(
             name="yo",
@@ -615,7 +617,10 @@ def test_container_arithmetic(actx_factory):
     grad_matvec_result = mock_gradient @ ary_of_dofs
     assert isinstance(grad_matvec_result.mass, DOFArray)
     assert grad_matvec_result.momentum.shape == (3,)
-    assert actx.np.linalg.norm(grad_matvec_result.mass - 3*ary_of_dofs**2) < 1e-8
+
+    res = grad_matvec_result.mass - 3*ary_of_dofs**2
+
+    assert np.linalg.norm(actx.to_numpy(res[0][0]) < 1e-8)
 
     # }}}
 
-- 
GitLab