@@ -210,15 +210,16 @@ class TestClass(typing.Generic[T, U, V]):
210210 override : int
211211
212212 # 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
213214 @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]
216217
217- TestAlias = TestClass2 [int , T ]
218+ TestAlias = TestClass2 [int , T ] # type: ignore[override]
218219
219220 # inherit from alias
220221 @dataclasses .dataclass
221- class TestClass3 (TestAlias [typing .List [int ]]):
222+ class TestClass3 (TestAlias [typing .List [int ]]): # type: ignore[override]
222223 pass
223224
224225 test_schema = class_schema (TestClass3 )()
@@ -430,10 +431,11 @@ class TestClass(typing.Generic[T, U, V]):
430431
431432 # Don't only override typevar, but switch order to further confuse things
432433 @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]
435437
436- TestAlias = TestClass2 [int , T ]
438+ TestAlias = TestClass2 [int , T ] # type: ignore[override]
437439 test_schema2 = class_schema (TestClass2 )()
438440 assert list (test_schema2 .fields ) == ["pairs" , "gen" , "override" ]
439441 assert isinstance (test_schema2 .fields ["pairs" ], marshmallow .fields .List )
@@ -452,7 +454,7 @@ class TestClass2(TestClass[str, W, U]):
452454
453455 # inherit from alias
454456 @dataclasses .dataclass
455- class TestClass3 (TestAlias [typing .List [int ]]):
457+ class TestClass3 (TestAlias [typing .List [int ]]): # type: ignore[override]
456458 pass
457459
458460 test_schema3 = class_schema (TestClass3 )()
0 commit comments