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

Function test_arraylike_signature

tests/test_numpy_array.py:738–749  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

736
737
738def test_arraylike_signature(doc):
739 assert (
740 doc(m.round_trip_array_t)
741 == "round_trip_array_t(x: typing.Annotated[numpy.typing.ArrayLike, numpy.float32]) -> numpy.typing.NDArray[numpy.float32]"
742 )
743 assert (
744 doc(m.round_trip_array_t_noconvert)
745 == "round_trip_array_t_noconvert(x: numpy.typing.NDArray[numpy.float32]) -> numpy.typing.NDArray[numpy.float32]"
746 )
747 m.round_trip_array_t([1, 2, 3])
748 with pytest.raises(TypeError, match="incompatible function arguments"):
749 m.round_trip_array_t_noconvert([1, 2, 3])

Callers

nothing calls this directly

Calls 1

docFunction · 0.70

Tested by

no test coverage detected