@@ -210,15 +210,16 @@ class TestClass(typing.Generic[T, U, V]):
210
210
override : int
211
211
212
212
# Don't only override typevar, but switch order to further confuse things
213
+ # Ignoring 'override' Because I want to test that it works, even if incompatible types
213
214
@dataclasses .dataclass
214
- class TestClass2 (TestClass [str , W , U ]):
215
- override : str # type: ignore # Want to test that it works, even if incompatible types
215
+ class TestClass2 (TestClass [str , W , U ]): # type: ignore[override]
216
+ override : str # type: ignore[override, assignment]
216
217
217
- TestAlias = TestClass2 [int , T ]
218
+ TestAlias = TestClass2 [int , T ] # type: ignore[override]
218
219
219
220
# inherit from alias
220
221
@dataclasses .dataclass
221
- class TestClass3 (TestAlias [typing .List [int ]]):
222
+ class TestClass3 (TestAlias [typing .List [int ]]): # type: ignore[override]
222
223
pass
223
224
224
225
test_schema = class_schema (TestClass3 )()
@@ -430,10 +431,11 @@ class TestClass(typing.Generic[T, U, V]):
430
431
431
432
# Don't only override typevar, but switch order to further confuse things
432
433
@dataclasses .dataclass
433
- class TestClass2 (TestClass [str , W , U ]):
434
- override : str # type: ignore # Want to test that it works, even if incompatible types
434
+ class TestClass2 (TestClass [str , W , U ]): # type: ignore[override]
435
+ # Want to test that it works, even if incompatible types
436
+ override : str # type: ignore[override, assignment]
435
437
436
- TestAlias = TestClass2 [int , T ]
438
+ TestAlias = TestClass2 [int , T ] # type: ignore[override]
437
439
test_schema2 = class_schema (TestClass2 )()
438
440
assert list (test_schema2 .fields ) == ["pairs" , "gen" , "override" ]
439
441
assert isinstance (test_schema2 .fields ["pairs" ], marshmallow .fields .List )
@@ -452,7 +454,7 @@ class TestClass2(TestClass[str, W, U]):
452
454
453
455
# inherit from alias
454
456
@dataclasses .dataclass
455
- class TestClass3 (TestAlias [typing .List [int ]]):
457
+ class TestClass3 (TestAlias [typing .List [int ]]): # type: ignore[override]
456
458
pass
457
459
458
460
test_schema3 = class_schema (TestClass3 )()
0 commit comments