From 63baae238730bb81b6ab4b9cd8580ade4fe01e95 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Jan 2022 22:26:44 +0100 Subject: [PATCH] documentation/python: add a test with full pybind11 docstrings. Those get currently ignored. --- .../test_python/pybind_signatures/pybind_signatures.cpp | 6 +++++- .../test_python/pybind_signatures/pybind_signatures.html | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/documentation/test_python/pybind_signatures/pybind_signatures.cpp b/documentation/test_python/pybind_signatures/pybind_signatures.cpp index a982f2b1..e6934b3f 100644 --- a/documentation/test_python/pybind_signatures/pybind_signatures.cpp +++ b/documentation/test_python/pybind_signatures/pybind_signatures.cpp @@ -75,7 +75,11 @@ PYBIND11_MODULE(pybind_signatures, m) { .def("tenOverloads", &tenOverloads, "Ten overloads of a function") .def("tenOverloads", &tenOverloads, "Ten overloads of a function") .def("tenOverloads", &tenOverloads, "Ten overloads of a function") - .def("tenOverloads", &tenOverloads, "Ten overloads of a function"); + .def("tenOverloads", &tenOverloads, "Ten overloads of a function") + + .def("full_docstring", &voidFunction, R"(A summary + +And a larger docstring as well, which is currently ignored.)"); py::class_(m, "MyClass", "My fun class!") .def_static("static_function", &MyClass::staticFunction, "Static method with positional-only args") diff --git a/documentation/test_python/pybind_signatures/pybind_signatures.html b/documentation/test_python/pybind_signatures/pybind_signatures.html index f844969e..19c79b1b 100644 --- a/documentation/test_python/pybind_signatures/pybind_signatures.html +++ b/documentation/test_python/pybind_signatures/pybind_signatures.html @@ -63,6 +63,10 @@ def failed_parse_docstring(…)
A failed parse should <strong>also</strong> escape the docstring
+
+ def full_docstring(arg0: int, /) -> None +
+
A summary
def overloaded(arg0: int, /) -> str
-- 2.30.2