mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
@@ -36,6 +36,7 @@ def test_from_python():
|
||||
@pytest.unsupported_on_pypy
|
||||
def test_to_python():
|
||||
m = Matrix(5, 5)
|
||||
assert memoryview(m).shape == (5, 5)
|
||||
|
||||
assert m[2, 3] == 0
|
||||
m[2, 3] = 4
|
||||
@@ -63,6 +64,16 @@ def test_to_python():
|
||||
assert cstats.move_assignments == 0
|
||||
|
||||
|
||||
@pytest.unsupported_on_pypy
|
||||
def test_inherited_protocol():
|
||||
"""SquareMatrix is derived from Matrix and inherits the buffer protocol"""
|
||||
from pybind11_tests import SquareMatrix
|
||||
|
||||
matrix = SquareMatrix(5)
|
||||
assert memoryview(matrix).shape == (5, 5)
|
||||
assert np.asarray(matrix).shape == (5, 5)
|
||||
|
||||
|
||||
@pytest.unsupported_on_pypy
|
||||
def test_ptmf():
|
||||
for cls in [PTMFBuffer, ConstPTMFBuffer, DerivedPTMFBuffer]:
|
||||
|
||||
Reference in New Issue
Block a user