|
59 | 59 | 'Argument 1 to "loads" has incompatible type "Union[bytes, str, None]"; '
|
60 | 60 | + 'expected "Union[str, bytes, bytearray]"',
|
61 | 61 | 'Incompatible types in assignment (expression has type "None", variable has type Module)',
|
62 |
| - 'note:' |
| 62 | + 'note:', |
| 63 | + # Suppress false-positive error due to mypy being overly strict with base class compatibility checks even though |
| 64 | + # objects/_default_manager are redefined in the subclass to be compatible with the base class definition. |
| 65 | + # Can be removed when mypy issue is fixed: https://github.com/python/mypy/issues/2619 |
| 66 | + re.compile(r'Definition of "(objects|_default_manager)" in base class "[A-Za-z0-9]+" is incompatible with ' |
| 67 | + r'definition in base class "[A-Za-z0-9]+"'), |
63 | 68 | ],
|
64 | 69 | 'admin_changelist': [
|
65 | 70 | 'Incompatible types in assignment (expression has type "FilteredChildAdmin", variable has type "ChildAdmin")'
|
|
213 | 218 | 'Unexpected keyword argument "headline__startswith" for "in_bulk" of "QuerySet"',
|
214 | 219 | ],
|
215 | 220 | 'many_to_one': [
|
216 |
| - 'Incompatible type for "parent" of "Child" (got "None", expected "Union[Parent, Combinable]")' |
| 221 | + 'Incompatible type for "parent" of "Child" (got "None", expected "Union[Parent, Combinable]")', |
| 222 | + 'Incompatible type for "parent" of "Child" (got "Child", expected "Union[Parent, Combinable]")' |
217 | 223 | ],
|
218 | 224 | 'model_meta': [
|
219 | 225 | '"object" has no attribute "items"',
|
220 |
| - '"Field" has no attribute "many_to_many"' |
| 226 | + '"Field" has no attribute "many_to_many"', |
221 | 227 | ],
|
222 | 228 | 'model_forms': [
|
223 | 229 | 'Argument "instance" to "InvalidModelForm" has incompatible type "Type[Category]"; expected "Optional[Model]"',
|
|
227 | 233 | 'Incompatible types in assignment (expression has type "Type[Person]", variable has type',
|
228 | 234 | 'Unexpected keyword argument "name" for "Person"',
|
229 | 235 | 'Cannot assign multiple types to name "PersonTwoImages" without an explicit "Type[...]" annotation',
|
230 |
| - 'Incompatible types in assignment (expression has type "Type[Person]", ' |
231 |
| - + 'base class "ImageFieldTestMixin" defined the type as "Type[PersonWithHeightAndWidth]")', |
| 236 | + re.compile( |
| 237 | + r'Incompatible types in assignment \(expression has type "Type\[.+?\]", base class "IntegerFieldTests"' |
| 238 | + r' defined the type as "Type\[IntegerModel\]"\)'), |
| 239 | + re.compile(r'Incompatible types in assignment \(expression has type "Type\[.+?\]", base class' |
| 240 | + r' "ImageFieldTestMixin" defined the type as "Type\[PersonWithHeightAndWidth\]"\)'), |
| 241 | + 'Incompatible import of "Person"', |
| 242 | + 'Incompatible types in assignment (expression has type "FloatModel", variable has type ' |
| 243 | + '"Union[float, int, str, Combinable]")', |
232 | 244 | ],
|
233 | 245 | 'model_formsets': [
|
234 | 246 | 'Incompatible types in string interpolation (expression has type "object", '
|
|
261 | 273 | 'Argument 1 to "RunPython" has incompatible type "str"; expected "Callable[..., Any]"',
|
262 | 274 | 'FakeLoader',
|
263 | 275 | 'Argument 1 to "append" of "list" has incompatible type "AddIndex"; expected "CreateModel"',
|
264 |
| - 'Unsupported operand types for - ("Set[Any]" and "None")' |
| 276 | + 'Unsupported operand types for - ("Set[Any]" and "None")', |
265 | 277 | ],
|
266 | 278 | 'middleware_exceptions': [
|
267 | 279 | 'Argument 1 to "append" of "list" has incompatible type "Tuple[Any, Any]"; expected "str"'
|
|
282 | 294 | + 'expected "Optional[Type[JSONEncoder]]"',
|
283 | 295 | 'for model "CITestModel"',
|
284 | 296 | 'Incompatible type for "field" of "IntegerArrayModel" (got "None", '
|
285 |
| - + 'expected "Union[Sequence[int], Combinable]")' |
| 297 | + + 'expected "Union[Sequence[int], Combinable]")', |
| 298 | + re.compile(r'Incompatible types in assignment \(expression has type "Type\[.+?\]", base class "UnaccentTest" ' |
| 299 | + r'defined the type as "Type\[CharFieldModel\]"\)'), |
| 300 | + 'Incompatible types in assignment (expression has type "Type[TextFieldModel]", base class "TrigramTest" ' |
| 301 | + 'defined the type as "Type[CharFieldModel]")', |
286 | 302 | ],
|
287 | 303 | 'properties': [
|
288 | 304 | re.compile('Unexpected attribute "(full_name|full_name_2)" for model "Person"')
|
|
291 | 307 | 'Incompatible types in assignment (expression has type "None", variable has type "str")',
|
292 | 308 | 'Invalid index type "Optional[str]" for "Dict[str, int]"; expected type "str"',
|
293 | 309 | 'No overload variant of "values_list" of "QuerySet" matches argument types "str", "bool", "bool"',
|
| 310 | + 'Unsupported operand types for & ("QuerySet[Author, Author]" and "QuerySet[Tag, Tag]")', |
| 311 | + 'Unsupported operand types for | ("QuerySet[Author, Author]" and "QuerySet[Tag, Tag]")', |
| 312 | + 'Incompatible types in assignment (expression has type "ObjectB", variable has type "ObjectA")', |
| 313 | + 'Incompatible types in assignment (expression has type "ObjectC", variable has type "ObjectA")', |
| 314 | + 'Incompatible type for "objectb" of "ObjectC" (got "ObjectA", expected' |
| 315 | + ' "Union[ObjectB, Combinable, None, None]")', |
294 | 316 | ],
|
295 | 317 | 'requests': [
|
296 | 318 | 'Incompatible types in assignment (expression has type "Dict[str, str]", variable has type "QueryDict")'
|
|
303 | 325 | '"None" has no attribute "__iter__"',
|
304 | 326 | 'has no attribute "read_by"'
|
305 | 327 | ],
|
| 328 | + 'proxy_model_inheritance': [ |
| 329 | + 'Incompatible import of "ProxyModel"' |
| 330 | + ], |
306 | 331 | 'signals': [
|
307 | 332 | 'Argument 1 to "append" of "list" has incompatible type "Tuple[Any, Any, Optional[Any], Any]"; '
|
308 | 333 | + 'expected "Tuple[Any, Any, Any]"'
|
|
387 | 412 | 'Incompatible types in assignment (expression has type "None", variable has type "int")',
|
388 | 413 | ],
|
389 | 414 | 'select_related_onetoone': [
|
390 |
| - '"None" has no attribute' |
| 415 | + '"None" has no attribute', |
| 416 | + 'Incompatible types in assignment (expression has type "Parent2", variable has type "Parent1")', |
391 | 417 | ],
|
392 | 418 | 'servers': [
|
393 | 419 | re.compile('Argument [0-9] to "WSGIRequestHandler"')
|
|
0 commit comments