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

Function test_array_failure

tests/test_numpy_array.py:467–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

465
466
467def test_array_failure():
468 with pytest.raises(ValueError) as excinfo:
469 m.array_fail_test()
470 assert str(excinfo.value) == "cannot create a pybind11::array from a nullptr"
471
472 with pytest.raises(ValueError) as excinfo:
473 m.array_t_fail_test()
474 assert str(excinfo.value) == "cannot create a pybind11::array_t from a nullptr"
475
476 with pytest.raises(ValueError) as excinfo:
477 m.array_fail_test_negative_size()
478 assert str(excinfo.value) == "negative dimensions are not allowed"
479
480
481def test_initializer_list():

Callers

nothing calls this directly

Calls 1

strClass · 0.85

Tested by

no test coverage detected