MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_pass_readonly_array

Function test_pass_readonly_array

tests/test_eigen_matrix.py:143–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141
142
143def test_pass_readonly_array():
144 z = np.full((5, 6), 42.0)
145 z.flags.writeable = False
146 np.testing.assert_array_equal(z, m.fixed_copy_r(z))
147 np.testing.assert_array_equal(m.fixed_r_const(), m.fixed_r())
148 assert not m.fixed_r_const().flags.writeable
149 np.testing.assert_array_equal(m.fixed_copy_r(m.fixed_r_const()), m.fixed_r_const())
150
151
152def test_nonunit_stride_from_python():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected