diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py index acf099716829400fd079fdf1dc0913c138a8dcd5..95666b09a9abd6b85ff81e3190ff06be16029572 100644 --- a/test/test_arraycontext.py +++ b/test/test_arraycontext.py @@ -36,7 +36,8 @@ from arraycontext import ( FirstAxisIsElementsTag, PyOpenCLArrayContext, PytatoPyOpenCLArrayContext, - ArrayContainer,) + ArrayContainer, + to_numpy) from arraycontext import ( # noqa: F401 pytest_generate_tests_for_array_contexts, ) @@ -1497,6 +1498,14 @@ def test_taggable_cl_array_tags(actx_factory): # }}} +def test_to_numpy_on_frozen_arrays(actx_factory): + # See https://github.com/inducer/arraycontext/issues/159 + actx = actx_factory() + u = actx.freeze(actx.zeros(10, dtype="float64")+1) + np.testing.assert_allclose(actx.to_numpy(u), 1) + np.testing.assert_allclose(to_numpy(u, actx), 1) + + if __name__ == "__main__": import sys if len(sys.argv) > 1: