| 270 | |
| 271 | @pytest.mark.parametrize("m", submodules) |
| 272 | def test_doc_string(m, doc): |
| 273 | assert ( |
| 274 | doc(m.copy_tensor) |
| 275 | == 'copy_tensor() -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[?, ?, ?]"]' |
| 276 | ) |
| 277 | assert ( |
| 278 | doc(m.copy_fixed_tensor) |
| 279 | == 'copy_fixed_tensor() -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[3, 5, 2]"]' |
| 280 | ) |
| 281 | assert ( |
| 282 | doc(m.reference_const_tensor) |
| 283 | == 'reference_const_tensor() -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[?, ?, ?]"]' |
| 284 | ) |
| 285 | |
| 286 | order_flag = f'"flags.{m.needed_options.lower()}_contiguous"' |
| 287 | assert doc(m.round_trip_view_tensor) == ( |
| 288 | f'round_trip_view_tensor(arg0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[?, ?, ?]", "flags.writeable", {order_flag}])' |
| 289 | f' -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[?, ?, ?]", "flags.writeable", {order_flag}]' |
| 290 | ) |
| 291 | assert doc(m.round_trip_const_view_tensor) == ( |
| 292 | f'round_trip_const_view_tensor(arg0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[?, ?, ?]", {order_flag}])' |
| 293 | ' -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[?, ?, ?]"]' |
| 294 | ) |
| 295 | |
| 296 | |
| 297 | @pytest.mark.parametrize("m", submodules) |