Skip to content

Commit 5f3f132

Browse files
committed
Fixup check-generic-subtyping
1 parent 6fb6623 commit 5f3f132

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

mypy/test/testcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
# List of files that contain test case descriptions.
2929
files = [
30-
'check-generic-subtyping.test',
3130
'check-varargs.test',
3231
]
3332
fast_parser_files = [
@@ -73,6 +72,7 @@
7372
'check-functions.test',
7473
'check-tuples.test',
7574
'check-expressions.test',
75+
'check-generic-subtyping.test',
7676
]
7777

7878
files.extend(fast_parser_files)

test-data/unit/check-generic-subtyping.test

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,6 @@ s, s = Nums() # E: Incompatible types in assignment (expression has type "int",
693693

694694
[case testCovariant]
695695
from typing import TypeVar, Generic
696-
True = 1
697-
698696
T = TypeVar('T', covariant=True)
699697

700698
class G(Generic[T]): pass
@@ -708,12 +706,11 @@ c = None # type: G[C]
708706

709707
b = a # E: Incompatible types in assignment (expression has type G[A], variable has type G[B])
710708
b = c
709+
[builtins fixtures/bool.pyi]
711710
[out]
712711

713712
[case testContravariant]
714713
from typing import TypeVar, Generic
715-
True = 1
716-
717714
T = TypeVar('T', contravariant=True)
718715

719716
class G(Generic[T]): pass
@@ -727,12 +724,11 @@ c = None # type: G[C]
727724

728725
b = a
729726
b = c # E: Incompatible types in assignment (expression has type G[C], variable has type G[B])
727+
[builtins fixtures/bool.pyi]
730728
[out]
731729

732730
[case testInvariant]
733731
from typing import TypeVar, Generic
734-
True = 1
735-
736732
T = TypeVar('T') # invariant (default)
737733

738734
class G(Generic[T]): pass
@@ -746,4 +742,5 @@ c = None # type: G[C]
746742

747743
b = a # E: Incompatible types in assignment (expression has type G[A], variable has type G[B])
748744
b = c # E: Incompatible types in assignment (expression has type G[C], variable has type G[B])
745+
[builtins fixtures/bool.pyi]
749746
[out]

0 commit comments

Comments
 (0)