diff --git a/tests/test_pytypes.cpp b/tests/test_pytypes.cpp index e1e3347181..43a0247208 100644 --- a/tests/test_pytypes.cpp +++ b/tests/test_pytypes.cpp @@ -977,7 +977,8 @@ TEST_SUBMODULE(pytypes, m) { m.def("identity_literal_percent", [](const py::typing::Literal<"\"%\""> &x) { return x; }); m.def("identity_literal_curly_open", [](const py::typing::Literal<"\"{\""> &x) { return x; }); m.def("identity_literal_curly_close", [](const py::typing::Literal<"\"}\""> &x) { return x; }); - m.def("identity_literal_arrow", [](const py::typing::Literal<"\"->\""> &x) { return x; }); + m.def("identity_literal_arrow_with_io_name", + [](const py::typing::Literal<"\"->\""> &x, const RealNumber &y) { return x; }); m.def("identity_literal_arrow_with_callable", [](const py::typing::Callable\""> &, const RealNumber &)> &x) { return x; }); diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index a6f3ca6585..9edc6ea5ec 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -1066,8 +1066,8 @@ def test_literal(doc): == 'identity_literal_curly_close(arg0: Literal["}"]) -> Literal["}"]' ) assert ( - doc(m.identity_literal_arrow) - == 'identity_literal_arrow(arg0: Literal["->"]) -> Literal["->"]' + doc(m.identity_literal_arrow_with_io_name) + == 'identity_literal_arrow_with_io_name(arg0: Literal["->"], arg1: Union[float, int]) -> Literal["->"]' ) assert ( doc(m.identity_literal_arrow_with_callable)