pybind11/tests/test_class_sh_property_bakein.py
Ralf W. Grosse-Kunstleve 3406be6877 New test_class_sh_property_bakein.py
Use cases in the wild:

* `test_readonly_char6_member()`: 4410c44ae6/torch/csrc/cuda/Module.cpp (L961)

* `test_readonly_const_char_ptr_member()`: 862a439a84/include/permonst.h (L43)
2024-07-13 23:46:36 -07:00

14 lines
337 B
Python

from __future__ import annotations
from pybind11_tests import class_sh_property_bakein as m
def test_readonly_char6_member():
obj = m.WithCharArrayMember()
assert obj.char6_member == "Char6"
def test_readonly_const_char_ptr_member():
obj = m.WithConstCharPtrMember()
assert obj.const_char_ptr_member == "ConstChar*"