1 from __future__
import annotations
3 from pybind11_tests
import docstring_options
as m
8 assert not m.test_function1.__doc__
10 assert m.test_function2.__doc__ ==
"A custom docstring"
13 assert m.test_overloaded1.__doc__ ==
"Overload docstring"
16 assert m.test_overloaded2.__doc__ ==
"overload docstring 1\noverload docstring 2"
19 assert m.test_overloaded3.__doc__ ==
"Overload docstr"
22 assert m.test_function3.__doc__.startswith(
"test_function3(a: int, b: int) -> None")
24 assert m.test_function4.__doc__.startswith(
"test_function4(a: int, b: int) -> None")
25 assert m.test_function4.__doc__.endswith(
"A custom docstring\n")
29 assert not m.test_function5.__doc__
32 assert m.test_function6.__doc__ ==
"A custom docstring"
35 assert m.test_function7.__doc__.startswith(
"test_function7(a: int, b: int) -> None")
36 assert m.test_function7.__doc__.endswith(
"A custom docstring\n")
39 assert m.test_function8.__doc__
is None
42 assert not m.DocstringTestFoo.__doc__
43 assert not m.DocstringTestFoo.value_prop.__doc__
47 m.DocstringTestEnum1.__doc__
48 ==
"Enum docstring\n\nMembers:\n\n Member1\n\n Member2"
53 m.DocstringTestEnum2.__doc__
54 ==
"Enum docstring\n\nMembers:\n\n Member1\n\n Member2"
58 assert m.DocstringTestEnum3.__doc__ ==
"Enum docstring"
61 assert m.DocstringTestEnum4.__doc__ ==
"Members:\n\n Member1\n\n Member2"
66 assert m.DocstringTestEnum5.__doc__
is None