1 2 3def test_docstring_options(): 4 from pybind11_tests import (test_function1, test_function2, test_function3, 5 test_function4, test_function5, test_function6,
| 1 2 3def test_docstring_options(): 4 from pybind11_tests import (test_function1, test_function2, test_function3, 5 test_function4, test_function5, test_function6,
|
6 test_function7, DocstringTestFoo)
| 6 test_function7, DocstringTestFoo, 7 test_overloaded1, test_overloaded2, test_overloaded3)
|
7 8 # options.disable_function_signatures() 9 assert not test_function1.__doc__ 10 11 assert test_function2.__doc__ == "A custom docstring" 12
| 8 9 # options.disable_function_signatures() 10 assert not test_function1.__doc__ 11 12 assert test_function2.__doc__ == "A custom docstring" 13
|
| 14 # docstring specified on just the first overload definition: 15 assert test_overloaded1.__doc__ == "Overload docstring" 16 17 # docstring on both overloads: 18 assert test_overloaded2.__doc__ == "overload docstring 1\noverload docstring 2" 19 20 # docstring on only second overload: 21 assert test_overloaded3.__doc__ == "Overload docstr" 22
|
13 # options.enable_function_signatures() 14 assert test_function3.__doc__ .startswith("test_function3(a: int, b: int) -> None") 15 16 assert test_function4.__doc__ .startswith("test_function4(a: int, b: int) -> None") 17 assert test_function4.__doc__ .endswith("A custom docstring\n") 18 19 # options.disable_function_signatures() 20 # options.disable_user_defined_docstrings()
--- 12 unchanged lines hidden --- | 23 # options.enable_function_signatures() 24 assert test_function3.__doc__ .startswith("test_function3(a: int, b: int) -> None") 25 26 assert test_function4.__doc__ .startswith("test_function4(a: int, b: int) -> None") 27 assert test_function4.__doc__ .endswith("A custom docstring\n") 28 29 # options.disable_function_signatures() 30 # options.disable_user_defined_docstrings()
--- 12 unchanged lines hidden --- |