63
63
64
64
# Mypy does not support recursive type aliases, but
65
65
# 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" ]]
69
69
70
70
71
71
class A :
@@ -119,12 +119,12 @@ def method(self: T) -> T: # type: ignore[empty-body]
119
119
pytest .param (types .CoroutineType , "types" , "CoroutineType" , (), id = "CoroutineType" ),
120
120
pytest .param (Any , "typing" , "Any" , (), id = "Any" ),
121
121
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" ),
128
128
pytest .param (Callable , "collections.abc" , "Callable" , (), id = "Callable" ),
129
129
pytest .param (Callable [..., str ], "collections.abc" , "Callable" , (..., str ), id = "Callable_returntype" ),
130
130
pytest .param (
@@ -177,8 +177,8 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
177
177
pytest .param (type (None ), ":py:obj:`None`" , id = "type None" ),
178
178
pytest .param (type , ":py:class:`type`" , id = "type" ),
179
179
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" ),
182
182
pytest .param (Any , ":py:data:`~typing.Any`" , id = "Any" ),
183
183
pytest .param (AnyStr , ":py:data:`~typing.AnyStr`" , id = "AnyStr" ),
184
184
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
205
205
r":py:class:`~collections.abc.Mapping`\ \[:py:class:`str`, :py:class:`bool`]" ,
206
206
id = "Mapping-str-bool" ,
207
207
),
208
- pytest .param (Dict , ":py:class:`~typing.Dict`" , id = "Dict" ), # noqa: UP006
208
+ pytest .param (Dict , ":py:class:`~typing.Dict`" , id = "Dict" ),
209
209
pytest .param (
210
- Dict [T , int ], # type: ignore[valid-type] # noqa: UP006
210
+ Dict [T , int ], # type: ignore[valid-type]
211
211
r":py:class:`~typing.Dict`\ \[:py:class:`~typing.TypeVar`\ \(``T``), :py:class:`int`]" ,
212
212
id = "Dict-T-int" ,
213
213
),
214
214
pytest .param (
215
- Dict [str , V_contra ], # type: ignore[valid-type] # noqa: UP006
215
+ Dict [str , V_contra ], # type: ignore[valid-type]
216
216
r":py:class:`~typing.Dict`\ \[:py:class:`str`, :py:class:`~typing.TypeVar`\ \(``V_contra``, "
217
217
r"contravariant=True)]" ,
218
218
id = "Dict-T-int-contra" ,
219
219
),
220
220
pytest .param (
221
- Dict [T , U_co ], # type: ignore[valid-type] # noqa: UP006
221
+ Dict [T , U_co ], # type: ignore[valid-type]
222
222
r":py:class:`~typing.Dict`\ \[:py:class:`~typing.TypeVar`\ \(``T``),"
223
223
r" :py:class:`~typing.TypeVar`\ \(``U_co``, covariant=True)]" ,
224
224
id = "Dict-T-int-co" ,
225
225
),
226
226
pytest .param (
227
- Dict [str , bool ], # noqa: UP006
227
+ Dict [str , bool ],
228
228
r":py:class:`~typing.Dict`\ \[:py:class:`str`, :py:class:`bool`]" ,
229
- id = "Dict-str-bool" , # noqa: RUF100, UP006
229
+ id = "Dict-str-bool" ,
230
230
),
231
- pytest .param (Tuple , ":py:data:`~typing.Tuple`" , id = "Tuple" ), # noqa: UP006
231
+ pytest .param (Tuple , ":py:data:`~typing.Tuple`" , id = "Tuple" ),
232
232
pytest .param (
233
- Tuple [str , bool ], # noqa: UP006
233
+ Tuple [str , bool ],
234
234
r":py:data:`~typing.Tuple`\ \[:py:class:`str`, :py:class:`bool`]" ,
235
- id = "Tuple-str-bool" , # noqa: RUF100, UP006
235
+ id = "Tuple-str-bool" ,
236
236
),
237
237
pytest .param (
238
- Tuple [int , int , int ], # noqa: UP006
238
+ Tuple [int , int , int ],
239
239
r":py:data:`~typing.Tuple`\ \[:py:class:`int`, :py:class:`int`, :py:class:`int`]" ,
240
240
id = "Tuple-int-int-int" ,
241
241
),
242
242
pytest .param (
243
- Tuple [str , ...], # noqa: UP006
243
+ Tuple [str , ...],
244
244
r":py:data:`~typing.Tuple`\ \[:py:class:`str`, :py:data:`...<Ellipsis>`]" ,
245
245
id = "Tuple-str-Ellipsis" ,
246
246
),
247
247
pytest .param (Union , ":py:data:`~typing.Union`" , id = "Union" ),
248
248
pytest .param (
249
- Union [str , bool ], # noqa: UP007
249
+ Union [str , bool ],
250
250
r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:class:`bool`]" ,
251
251
id = "Union-str-bool" ,
252
252
),
253
253
pytest .param (
254
- Union [str , bool , None ], # noqa: UP007
254
+ Union [str , bool , None ],
255
255
r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:class:`bool`, :py:obj:`None`]" ,
256
256
id = "Union-str-bool-None" ,
257
257
),
258
258
pytest .param (
259
- Union [str , Any ], # noqa: UP007
259
+ Union [str , Any ],
260
260
r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:data:`~typing.Any`]" ,
261
261
id = "Union-str-Any" ,
262
262
),
263
263
pytest .param (
264
- Optional [str ], # noqa: UP007
264
+ Optional [str ],
265
265
r":py:data:`~typing.Optional`\ \[:py:class:`str`]" ,
266
266
id = "Optional-str" ,
267
267
),
268
268
pytest .param (
269
- Union [str , None ], # noqa: UP007
269
+ Union [str , None ],
270
270
r":py:data:`~typing.Optional`\ \[:py:class:`str`]" ,
271
271
id = "Optional-str-None" ,
272
272
),
273
273
pytest .param (
274
- Optional [str | bool ], # noqa: UP007
274
+ Optional [str | bool ],
275
275
r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:class:`bool`, :py:obj:`None`]" ,
276
276
id = "Optional-Union-str-bool" ,
277
277
),
@@ -345,17 +345,17 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
345
345
pytest .param (P_bound , r":py:class:`~typing.ParamSpec`\ \(``P_bound``, bound= :py:class:`str`)" , id = "P-bound" ),
346
346
# ## These test for correct internal tuple rendering, even if not all are valid Tuple types
347
347
# 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" ),
349
349
# 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" ),
351
351
pytest .param (
352
- Tuple [int , int ], # noqa: UP006
352
+ Tuple [int , int ],
353
353
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" ,
355
355
),
356
356
# Ellipsis in single tuple also gets flattened
357
357
pytest .param (
358
- Tuple [int , ...], # noqa: UP006
358
+ Tuple [int , ...],
359
359
r":py:data:`~typing.Tuple`\ \[:py:class:`int`, :py:data:`...<Ellipsis>`]" ,
360
360
id = "Tuple-p-Ellipsis" ,
361
361
),
0 commit comments