diff --git a/tests/test_pytypes.cpp b/tests/test_pytypes.cpp index da9fcaea..e70ffae9 100644 --- a/tests/test_pytypes.cpp +++ b/tests/test_pytypes.cpp @@ -13,6 +13,10 @@ TEST_SUBMODULE(pytypes, m) { // test_int m.def("get_int", []{return py::int_(0);}); + // test_iterator + m.def("get_iterator", []{return py::iterator();}); + // test_iterable + m.def("get_iterable", []{return py::iterable();}); // test_list m.def("get_list", []() { py::list list; diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index 89ec2858..d6223b9b 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -5,9 +5,19 @@ import sys from pybind11_tests import pytypes as m from pybind11_tests import debug_enabled + def test_int(doc): assert doc(m.get_int) == "get_int() -> int" + +def test_iterator(doc): + assert doc(m.get_iterator) == "get_iterator() -> Iterator" + + +def test_iterable(doc): + assert doc(m.get_iterable) == "get_iterable() -> Iterable" + + def test_list(capture, doc): with capture: lst = m.get_list()