def test_at(arr):
    from pybind11_tests.array import at_t, mutate_at_t

    assert at_t(arr, 0, 2) == 3
    assert at_t(arr, 1, 0) == 4

    assert all(mutate_at_t(arr, 0, 2).ravel() == [1, 2, 4, 4, 5, 6])
    assert all(mutate_at_t(arr, 1, 0).ravel() == [1, 2, 4, 5, 5, 6])
Beispiel #2
0
def test_at(arr):
    from pybind11_tests.array import at_t, mutate_at_t

    assert at_t(arr, 0, 2) == 3
    assert at_t(arr, 1, 0) == 4

    assert all(mutate_at_t(arr, 0, 2).ravel() == [1, 2, 4, 4, 5, 6])
    assert all(mutate_at_t(arr, 1, 0).ravel() == [1, 2, 4, 5, 5, 6])
Beispiel #3
0
def test_at(arr):
    from pybind11_tests.array import at_t, mutate_at_t

    if at_t(arr, 0, 2) != 3:
        raise AssertionError
    if at_t(arr, 1, 0) != 4:
        raise AssertionError

    if not all(mutate_at_t(arr, 0, 2).ravel() == [1, 2, 4, 4, 5, 6]):
        raise AssertionError
    if not all(mutate_at_t(arr, 1, 0).ravel() == [1, 2, 4, 5, 5, 6]):
        raise AssertionError