You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test-data/unit/check-classes.test
+11-15Lines changed: 11 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -4758,9 +4758,7 @@ class X(type): pass
4758
4758
class Y(type): pass
4759
4759
class A(metaclass=X): pass
4760
4760
class B(A, metaclass=Y): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
4761
-
# N: __main__.Y (meta of __main__.B) conflicts with __main__.X (metaclass of __main__.A)
4762
-
4763
-
4761
+
# N: "__main__.Y" (metaclass of "__main__.B") conflicts with "__main__.X" (metaclass of "__main__.A")
4764
4762
[case testMetaclassNoTypeReveal]
4765
4763
class M:
4766
4764
x = 0 # type: int
@@ -5757,10 +5755,9 @@ class M1(type): pass
5757
5755
class Q1(metaclass=M1): pass
5758
5756
@six.add_metaclass(M)
5759
5757
class CQA(Q1): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
5760
-
# N: __main__.M (meta of __main__.CQA) conflicts with __main__.M1 (metaclass of __main__.Q1)
5758
+
# N: "__main__.M" (metaclass of "__main__.CQA") conflicts with "__main__.M1" (metaclass of "__main__.Q1")
5761
5759
class CQW(six.with_metaclass(M, Q1)): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
5762
-
# N: __main__.M (meta of __main__.CQW) conflicts with __main__.M1 (metaclass of __main__.Q1)
5763
-
5760
+
# N: "__main__.M" (metaclass of "__main__.CQW") conflicts with "__main__.M1" (metaclass of "__main__.Q1")
5764
5761
[builtins fixtures/tuple.pyi]
5765
5762
5766
5763
[case testSixMetaclassAny]
@@ -5879,8 +5876,7 @@ class C5(future.utils.with_metaclass(f())): pass # E: Dynamic metaclass not sup
5879
5876
class M1(type): pass
5880
5877
class Q1(metaclass=M1): pass
5881
5878
class CQW(future.utils.with_metaclass(M, Q1)): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
5882
-
# N: __main__.M (meta of __main__.CQW) conflicts with __main__.M1 (metaclass of __main__.Q1)
5883
-
5879
+
# N: "__main__.M" (metaclass of "__main__.CQW") conflicts with "__main__.M1" (metaclass of "__main__.Q1")
5884
5880
[builtins fixtures/tuple.pyi]
5885
5881
5886
5882
[case testFutureMetaclassAny]
@@ -7350,21 +7346,21 @@ class CorrectWithType1(C, A1): ...
7350
7346
class CorrectWithType2(B, C): ...
7351
7347
7352
7348
class Conflict1(A1, B, E): ... # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
7353
-
# N: __main__.MyMeta1 (metaclass of __main__.A) conflicts with __main__.MyMeta2 (metaclass of __main__.B)
7349
+
# N: "__main__.MyMeta1" (metaclass of "__main__.A") conflicts with "__main__.MyMeta2" (metaclass of "__main__.B")
7354
7350
class Conflict2(A, B): ... # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
7355
-
# N: __main__.MyMeta1 (metaclass of __main__.A) conflicts with __main__.MyMeta2 (metaclass of __main__.B)
7351
+
# N: "__main__.MyMeta1" (metaclass of "__main__.A") conflicts with "__main__.MyMeta2" (metaclass of "__main__.B")
7356
7352
class Conflict3(B, A): ... # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
7357
-
# N: __main__.MyMeta2 (metaclass of __main__.B) conflicts with __main__.MyMeta1 (metaclass of __main__.A)
7353
+
# N: "__main__.MyMeta2" (metaclass of "__main__.B") conflicts with "__main__.MyMeta1" (metaclass of "__main__.A")
7358
7354
7359
7355
class ChildOfConflict1(Conflict3): ...
7360
7356
class ChildOfConflict2(Conflict3, metaclass=CorrectMeta): ...
7361
7357
7362
7358
class ConflictingMeta(MyMeta1, MyMeta3): ...
7363
7359
class Conflict4(A1, B, E, metaclass=ConflictingMeta): ... # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
7364
-
# N: __main__.ConflictingMeta (meta of __main__.Conflict4) conflicts with __main__.MyMeta2 (metaclass of __main__.B)
7360
+
# N: "__main__.ConflictingMeta" (metaclass of "__main__.Conflict4") conflicts with "__main__.MyMeta2" (metaclass of "__main__.B")
7365
7361
7366
7362
class ChildOfCorrectButWrongMeta(CorrectSubclass1, metaclass=ConflictingMeta): # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
7367
-
# N: __main__.ConflictingMeta (meta of __main__.ChildOfCorrectButWrongMeta) conflicts with __main__.CorrectMeta (metaclass of __main__.CorrectSubclass1)
7363
+
# N: "__main__.ConflictingMeta" (metaclass of "__main__.ChildOfCorrectButWrongMeta") conflicts with "__main__.CorrectMeta" (metaclass of "__main__.CorrectSubclass1")
7368
7364
...
7369
7365
7370
7366
[case testMetaClassConflictIssue14033]
@@ -7380,9 +7376,9 @@ class B1(metaclass=M2): pass
7380
7376
class C1(metaclass=Mx): pass
7381
7377
7382
7378
class TestABC(A2, B1, C1): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
7383
-
# N: __main__.M1 (metaclass of __main__.A1) conflicts with __main__.M2 (metaclass of __main__.B1)
7379
+
# N: "__main__.M1" (metaclass of "__main__.A1") conflicts with "__main__.M2" (metaclass of "__main__.B1")
7384
7380
class TestBAC(B1, A2, C1): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases \
7385
-
# N: __main__.M2 (metaclass of __main__.B1) conflicts with __main__.M1 (metaclass of __main__.A1)
7381
+
# N: "__main__.M2" (metaclass of "__main__.B1") conflicts with "__main__.M1" (metaclass of "__main__.A1")
Copy file name to clipboardExpand all lines: test-data/unit/check-errorcodes.test
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1276,7 +1276,9 @@ class X(type): pass
1276
1276
class Y(type): pass
1277
1277
class A(metaclass=X): pass
1278
1278
class B(A, metaclass=Y): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases [metaclass] \
1279
-
# N: __main__.Y (meta of __main__.B) conflicts with __main__.X (metaclass of __main__.A)
1279
+
# N: "__main__.Y" (metaclass of "__main__.B") conflicts with "__main__.X" (metaclass of "__main__.A")
0 commit comments