Deleted Added
sdiff udiff text old ( 11986:c12e4625ab56 ) new ( 12037:d28054ac6ec9 )
full compact
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,
7 test_overloaded1, test_overloaded2, test_overloaded3)
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
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 ---