|
1 |
| -from typing import Any, ForwardRef, List, Union |
| 1 | +from typing import Any, ForwardRef, Union |
2 | 2 |
|
3 | 3 | from end_to_end_tests.functional_tests.helpers import (
|
4 | 4 | assert_model_decode_encode,
|
@@ -65,9 +65,9 @@ def test_array_of_object(self, ModelWithArrayOfObjects, SimpleObject):
|
65 | 65 | )
|
66 | 66 |
|
67 | 67 | def test_type_hints(self, ModelWithArrayOfAny, ModelWithArrayOfInts, ModelWithArrayOfObjects, Unset):
|
68 |
| - assert_model_property_type_hint(ModelWithArrayOfAny, "array_prop", Union[List[Any], Unset]) |
69 |
| - assert_model_property_type_hint(ModelWithArrayOfInts, "array_prop", Union[List[int], Unset]) |
70 |
| - assert_model_property_type_hint(ModelWithArrayOfObjects, "array_prop", Union[List[ForwardRef("SimpleObject")], Unset]) |
| 68 | + assert_model_property_type_hint(ModelWithArrayOfAny, "array_prop", Union[list[Any], Unset]) |
| 69 | + assert_model_property_type_hint(ModelWithArrayOfInts, "array_prop", Union[list[int], Unset]) |
| 70 | + assert_model_property_type_hint(ModelWithArrayOfObjects, "array_prop", Union[list["SimpleObject"], Unset]) |
71 | 71 |
|
72 | 72 |
|
73 | 73 | @with_generated_client_fixture(
|
@@ -133,16 +133,16 @@ def test_prefix_items_and_regular_items(self, ModelWithMixedItems, SimpleObject)
|
133 | 133 | )
|
134 | 134 |
|
135 | 135 | def test_type_hints(self, ModelWithSinglePrefixItem, ModelWithPrefixItems, ModelWithMixedItems, Unset):
|
136 |
| - assert_model_property_type_hint(ModelWithSinglePrefixItem, "array_prop", Union[List[str], Unset]) |
| 136 | + assert_model_property_type_hint(ModelWithSinglePrefixItem, "array_prop", Union[list[str], Unset]) |
137 | 137 | assert_model_property_type_hint(
|
138 | 138 | ModelWithPrefixItems,
|
139 | 139 | "array_prop",
|
140 |
| - Union[List[Union[ForwardRef("SimpleObject"), str]], Unset], |
| 140 | + Union[list[Union[ForwardRef("SimpleObject"), str]], Unset], |
141 | 141 | )
|
142 | 142 | assert_model_property_type_hint(
|
143 | 143 | ModelWithMixedItems,
|
144 | 144 | "array_prop",
|
145 |
| - Union[List[Union[ForwardRef("SimpleObject"), str]], Unset], |
| 145 | + Union[list[Union[ForwardRef("SimpleObject"), str]], Unset], |
146 | 146 | )
|
147 | 147 | # Note, this test is asserting the current behavior which, due to limitations of the implementation
|
148 | 148 | # (see: https://github.com/openapi-generators/openapi-python-client/pull/1130), is not really doing
|
|
0 commit comments