From 981e0a3c832cbef4928c21bd55d840671a2250d7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 01:09:58 +0000 Subject: [PATCH] style: pre-commit fixes --- tests/test_pytypes.cpp | 7 +++---- tests/test_pytypes.py | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_pytypes.cpp b/tests/test_pytypes.cpp index 9380c8bfb..311aa50b5 100644 --- a/tests/test_pytypes.cpp +++ b/tests/test_pytypes.cpp @@ -1058,12 +1058,11 @@ TEST_SUBMODULE(pytypes, m) { instance.def(py::init()); instance.attr_with_type_hint("y"); - m.def("attr_with_type_hint_float_x", [](py::handle obj) { - obj.attr_with_type_hint("x"); - }); + m.def("attr_with_type_hint_float_x", + [](py::handle obj) { obj.attr_with_type_hint("x"); }); m.attr_with_type_hint>("CONST_INT") = 3; - + m.attr("defined___cpp_inline_variables") = true; #else m.attr("defined___cpp_inline_variables") = false; diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index 4c6ee8da9..9303b9401 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -1162,9 +1162,12 @@ def test_redeclaration_attr_with_type_hint() -> None: m.attr_with_type_hint_float_x(obj) help(obj) assert get_annotations_helper(obj)["x"] == "float" - with pytest.raises(RuntimeError, match=r'^__annotations__\["x"\] was set already\.$'): + with pytest.raises( + RuntimeError, match=r'^__annotations__\["x"\] was set already\.$' + ): m.attr_with_type_hint_float_x(obj) + @pytest.mark.skipif( not m.defined___cpp_inline_variables, reason="C++17 feature __cpp_inline_variables not available.",