6363
6464# Mypy does not support recursive type aliases, but
6565# other type checkers do.
66- RecList = Union [int , List ["RecList" ]] # noqa: UP006, UP007
67- MutualRecA = Union [bool , List ["MutualRecB" ]] # noqa: UP006, UP007
68- MutualRecB = Union [str , List ["MutualRecA" ]] # noqa: UP006, UP007
66+ RecList = Union [int , List ["RecList" ]]
67+ MutualRecA = Union [bool , List ["MutualRecB" ]]
68+ MutualRecB = Union [str , List ["MutualRecA" ]]
6969
7070
7171class A :
@@ -119,12 +119,12 @@ def method(self: T) -> T: # type: ignore[empty-body]
119119 pytest .param (types .CoroutineType , "types" , "CoroutineType" , (), id = "CoroutineType" ),
120120 pytest .param (Any , "typing" , "Any" , (), id = "Any" ),
121121 pytest .param (AnyStr , "typing" , "AnyStr" , (), id = "AnyStr" ),
122- pytest .param (Dict , "typing" , "Dict" , (), id = "Dict" ), # noqa: UP006
123- pytest .param (Dict [str , int ], "typing" , "Dict" , (str , int ), id = "Dict_parametrized" ), # noqa: UP006
124- pytest .param (Dict [T , int ], "typing" , "Dict" , (T , int ), id = "Dict_typevar" ), # type: ignore[valid-type] # noqa: UP006
125- pytest .param (Tuple , "typing" , "Tuple" , (), id = "Tuple" ), # noqa: UP006
126- pytest .param (Tuple [str , int ], "typing" , "Tuple" , (str , int ), id = "Tuple_parametrized" ), # noqa: UP006
127- pytest .param (Union [str , int ], "typing" , "Union" , (str , int ), id = "Union" ), # noqa: UP007
122+ pytest .param (Dict , "typing" , "Dict" , (), id = "Dict" ),
123+ pytest .param (Dict [str , int ], "typing" , "Dict" , (str , int ), id = "Dict_parametrized" ),
124+ pytest .param (Dict [T , int ], "typing" , "Dict" , (T , int ), id = "Dict_typevar" ), # type: ignore[valid-type]
125+ pytest .param (Tuple , "typing" , "Tuple" , (), id = "Tuple" ),
126+ pytest .param (Tuple [str , int ], "typing" , "Tuple" , (str , int ), id = "Tuple_parametrized" ),
127+ pytest .param (Union [str , int ], "typing" , "Union" , (str , int ), id = "Union" ),
128128 pytest .param (Callable , "collections.abc" , "Callable" , (), id = "Callable" ),
129129 pytest .param (Callable [..., str ], "collections.abc" , "Callable" , (..., str ), id = "Callable_returntype" ),
130130 pytest .param (
@@ -177,8 +177,8 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
177177 pytest .param (type (None ), ":py:obj:`None`" , id = "type None" ),
178178 pytest .param (type , ":py:class:`type`" , id = "type" ),
179179 pytest .param (Callable , ":py:class:`~collections.abc.Callable`" , id = "abc-Callable" ),
180- pytest .param (Type , ":py:class:`~typing.Type`" , id = "typing-Type" ), # noqa: UP006
181- pytest .param (Type [A ], rf":py:class:`~typing.Type`\ \[:py:class:`~{ __name__ } .A`]" , id = "typing-A" ), # noqa: UP006
180+ pytest .param (Type , ":py:class:`~typing.Type`" , id = "typing-Type" ),
181+ pytest .param (Type [A ], rf":py:class:`~typing.Type`\ \[:py:class:`~{ __name__ } .A`]" , id = "typing-A" ),
182182 pytest .param (Any , ":py:data:`~typing.Any`" , id = "Any" ),
183183 pytest .param (AnyStr , ":py:data:`~typing.AnyStr`" , id = "AnyStr" ),
184184 pytest .param (Generic [T ], r":py:class:`~typing.Generic`\ \[:py:class:`~typing.TypeVar`\ \(``T``)]" , id = "Generic" ),
@@ -205,73 +205,73 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
205205 r":py:class:`~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bool`]" ,
206206 id = "Mapping-str-bool" ,
207207 ),
208- pytest .param (Dict , ":py:class:`~typing.Dict`" , id = "Dict" ), # noqa: UP006
208+ pytest .param (Dict , ":py:class:`~typing.Dict`" , id = "Dict" ),
209209 pytest .param (
210- Dict [T , int ], # type: ignore[valid-type] # noqa: UP006
210+ Dict [T , int ], # type: ignore[valid-type]
211211 r":py:class:`~typing.Dict`\ \[:py:class:`~typing.TypeVar`\ \(``T``), :py:class:`int`]" ,
212212 id = "Dict-T-int" ,
213213 ),
214214 pytest .param (
215- Dict [str , V_contra ], # type: ignore[valid-type] # noqa: UP006
215+ Dict [str , V_contra ], # type: ignore[valid-type]
216216 r":py:class:`~typing.Dict`\ \[:py:class:`str`, :py:class:`~typing.TypeVar`\ \(``V_contra``, "
217217 r"contravariant=True)]" ,
218218 id = "Dict-T-int-contra" ,
219219 ),
220220 pytest .param (
221- Dict [T , U_co ], # type: ignore[valid-type] # noqa: UP006
221+ Dict [T , U_co ], # type: ignore[valid-type]
222222 r":py:class:`~typing.Dict`\ \[:py:class:`~typing.TypeVar`\ \(``T``),"
223223 r" :py:class:`~typing.TypeVar`\ \(``U_co``, covariant=True)]" ,
224224 id = "Dict-T-int-co" ,
225225 ),
226226 pytest .param (
227- Dict [str , bool ], # noqa: UP006
227+ Dict [str , bool ],
228228 r":py:class:`~typing.Dict`\ \[:py:class:`str`, :py:class:`bool`]" ,
229- id = "Dict-str-bool" , # noqa: RUF100, UP006
229+ id = "Dict-str-bool" ,
230230 ),
231- pytest .param (Tuple , ":py:data:`~typing.Tuple`" , id = "Tuple" ), # noqa: UP006
231+ pytest .param (Tuple , ":py:data:`~typing.Tuple`" , id = "Tuple" ),
232232 pytest .param (
233- Tuple [str , bool ], # noqa: UP006
233+ Tuple [str , bool ],
234234 r":py:data:`~typing.Tuple`\ \[:py:class:`str`, :py:class:`bool`]" ,
235- id = "Tuple-str-bool" , # noqa: RUF100, UP006
235+ id = "Tuple-str-bool" ,
236236 ),
237237 pytest .param (
238- Tuple [int , int , int ], # noqa: UP006
238+ Tuple [int , int , int ],
239239 r":py:data:`~typing.Tuple`\ \[:py:class:`int`, :py:class:`int`, :py:class:`int`]" ,
240240 id = "Tuple-int-int-int" ,
241241 ),
242242 pytest .param (
243- Tuple [str , ...], # noqa: UP006
243+ Tuple [str , ...],
244244 r":py:data:`~typing.Tuple`\ \[:py:class:`str`, :py:data:`...<Ellipsis>`]" ,
245245 id = "Tuple-str-Ellipsis" ,
246246 ),
247247 pytest .param (Union , ":py:data:`~typing.Union`" , id = "Union" ),
248248 pytest .param (
249- Union [str , bool ], # noqa: UP007
249+ Union [str , bool ],
250250 r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:class:`bool`]" ,
251251 id = "Union-str-bool" ,
252252 ),
253253 pytest .param (
254- Union [str , bool , None ], # noqa: UP007
254+ Union [str , bool , None ],
255255 r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:class:`bool`, :py:obj:`None`]" ,
256256 id = "Union-str-bool-None" ,
257257 ),
258258 pytest .param (
259- Union [str , Any ], # noqa: UP007
259+ Union [str , Any ],
260260 r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:data:`~typing.Any`]" ,
261261 id = "Union-str-Any" ,
262262 ),
263263 pytest .param (
264- Optional [str ], # noqa: UP007
264+ Optional [str ],
265265 r":py:data:`~typing.Optional`\ \[:py:class:`str`]" ,
266266 id = "Optional-str" ,
267267 ),
268268 pytest .param (
269- Union [str , None ], # noqa: UP007
269+ Union [str , None ],
270270 r":py:data:`~typing.Optional`\ \[:py:class:`str`]" ,
271271 id = "Optional-str-None" ,
272272 ),
273273 pytest .param (
274- Optional [str | bool ], # noqa: UP007
274+ Optional [str | bool ],
275275 r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:class:`bool`, :py:obj:`None`]" ,
276276 id = "Optional-Union-str-bool" ,
277277 ),
@@ -345,17 +345,17 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
345345 pytest .param (P_bound , r":py:class:`~typing.ParamSpec`\ \(``P_bound``, bound= :py:class:`str`)" , id = "P-bound" ),
346346 # ## These test for correct internal tuple rendering, even if not all are valid Tuple types
347347 # Zero-length tuple remains
348- pytest .param (Tuple [()], ":py:data:`~typing.Tuple`" , id = "Tuple-p" ), # noqa: UP006
348+ pytest .param (Tuple [()], ":py:data:`~typing.Tuple`" , id = "Tuple-p" ),
349349 # Internal single tuple with simple types is flattened in the output
350- pytest .param (Tuple [int ,], r":py:data:`~typing.Tuple`\ \[:py:class:`int`]" , id = "Tuple-p-int" ), # noqa: UP006
350+ pytest .param (Tuple [int ,], r":py:data:`~typing.Tuple`\ \[:py:class:`int`]" , id = "Tuple-p-int" ),
351351 pytest .param (
352- Tuple [int , int ], # noqa: UP006
352+ Tuple [int , int ],
353353 r":py:data:`~typing.Tuple`\ \[:py:class:`int`, :py:class:`int`]" ,
354- id = "Tuple-p-int-int" , # noqa: RUF100, UP006
354+ id = "Tuple-p-int-int" ,
355355 ),
356356 # Ellipsis in single tuple also gets flattened
357357 pytest .param (
358- Tuple [int , ...], # noqa: UP006
358+ Tuple [int , ...],
359359 r":py:data:`~typing.Tuple`\ \[:py:class:`int`, :py:data:`...<Ellipsis>`]" ,
360360 id = "Tuple-p-Ellipsis" ,
361361 ),
0 commit comments