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

Function test_bad_cpp_to_python_casts

tests/test_eigen_tensor.py:115–133  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

113
114@pytest.mark.parametrize("m", submodules)
115def test_bad_cpp_to_python_casts(m):
116 with pytest.raises(
117 RuntimeError, match="Cannot use reference internal when there is no parent"
118 ):
119 m.reference_tensor_internal()
120
121 with pytest.raises(RuntimeError, match="Cannot move from a constant reference"):
122 m.move_const_tensor()
123
124 with pytest.raises(
125 RuntimeError, match="Cannot take ownership of a const reference"
126 ):
127 m.take_const_tensor()
128
129 with pytest.raises(
130 RuntimeError,
131 match="Invalid return_value_policy for Eigen Map type, must be either reference or reference_internal",
132 ):
133 m.take_view_tensor()
134
135
136@pytest.mark.parametrize("m", submodules)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected