@@ -989,7 +989,8 @@ def test_fn_return_only(doc):
989989
990990def test_type_annotation (doc ):
991991 assert (
992- doc (m .annotate_type ) == "annotate_type(arg0: type[typing.SupportsInt | typing.SupportsIndex]) -> type"
992+ doc (m .annotate_type )
993+ == "annotate_type(arg0: type[typing.SupportsInt | typing.SupportsIndex]) -> type"
993994 )
994995
995996
@@ -1167,7 +1168,10 @@ def get_annotations_helper(o):
11671168def test_module_attribute_types () -> None :
11681169 module_annotations = get_annotations_helper (m )
11691170
1170- assert module_annotations ["list_int" ] == "list[typing.SupportsInt | typing.SupportsIndex]"
1171+ assert (
1172+ module_annotations ["list_int" ]
1173+ == "list[typing.SupportsInt | typing.SupportsIndex]"
1174+ )
11711175 assert module_annotations ["set_str" ] == "set[str]"
11721176 assert module_annotations ["foo" ] == "pybind11_tests.pytypes.foo"
11731177
@@ -1190,7 +1194,10 @@ def test_get_annotations_compliance() -> None:
11901194
11911195 module_annotations = get_annotations (m )
11921196
1193- assert module_annotations ["list_int" ] == "list[typing.SupportsInt | typing.SupportsIndex]"
1197+ assert (
1198+ module_annotations ["list_int" ]
1199+ == "list[typing.SupportsInt | typing.SupportsIndex]"
1200+ )
11941201 assert module_annotations ["set_str" ] == "set[str]"
11951202
11961203
@@ -1204,7 +1211,10 @@ def test_class_attribute_types() -> None:
12041211 instance_annotations = get_annotations_helper (m .Instance )
12051212
12061213 assert empty_annotations is None
1207- assert static_annotations ["x" ] == "typing.ClassVar[typing.SupportsFloat | typing.SupportsIndex]"
1214+ assert (
1215+ static_annotations ["x" ]
1216+ == "typing.ClassVar[typing.SupportsFloat | typing.SupportsIndex]"
1217+ )
12081218 assert (
12091219 static_annotations ["dict_str_int" ]
12101220 == "typing.ClassVar[dict[str, typing.SupportsInt | typing.SupportsIndex]]"
@@ -1236,7 +1246,10 @@ def test_class_attribute_types() -> None:
12361246def test_redeclaration_attr_with_type_hint () -> None :
12371247 obj = m .Instance ()
12381248 m .attr_with_type_hint_float_x (obj )
1239- assert get_annotations_helper (obj )["x" ] == "typing.SupportsFloat | typing.SupportsIndex"
1249+ assert (
1250+ get_annotations_helper (obj )["x" ]
1251+ == "typing.SupportsFloat | typing.SupportsIndex"
1252+ )
12401253 with pytest .raises (
12411254 RuntimeError , match = r'^__annotations__\["x"\] was set already\.$'
12421255 ):
0 commit comments