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

Function test_docstrings

tests/test_class.py:130–154  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

128
129
130def test_docstrings(doc):
131 assert doc(UserType) == "A `py::class_` type for testing"
132 assert UserType.__name__ == "UserType"
133 assert UserType.__module__ == "pybind11_tests"
134 assert UserType.get_value.__name__ == "get_value"
135 assert UserType.get_value.__module__ == "pybind11_tests"
136
137 assert (
138 doc(UserType.get_value)
139 == """
140 get_value(self: m.UserType) -> int
141
142 Get value using a method
143 """
144 )
145 assert doc(UserType.value) == "Get/set value using a property"
146
147 assert (
148 doc(m.NoConstructor.new_instance)
149 == """
150 new_instance() -> m.class_.NoConstructor
151
152 Return an instance
153 """
154 )
155
156
157def test_qualname(doc):

Callers

nothing calls this directly

Calls 1

docFunction · 0.70

Tested by

no test coverage detected