Skip to content

Commit 3734a95

Browse files
author
Guido van Rossum
committed
Make tests more specific using the a() hack.
1 parent c2c96c9 commit 3734a95

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

mypy/test/data/check-inference.test

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,56 +1643,56 @@ a2.foo2()
16431643
[case testUnificationEmptyListLeft]
16441644
def f(): pass
16451645
a = [] if f() else [0]
1646-
a.append(0)
1646+
a() # E: List[int] not callable
16471647
[builtins fixtures/list.py]
16481648

16491649
[case testUnificationEmptyListRight]
16501650
def f(): pass
16511651
a = [0] if f() else []
1652-
a.append(0)
1652+
a() # E: List[int] not callable
16531653
[builtins fixtures/list.py]
16541654

16551655
[case testUnificationEmptyListLeftInContext]
16561656
from typing import List
16571657
def f(): pass
16581658
a = [] if f() else [0] # type: List[int]
1659-
a.append(0)
1659+
a() # E: List[int] not callable
16601660
[builtins fixtures/list.py]
16611661

16621662
[case testUnificationEmptyListRightInContext]
16631663
# TODO Find an example that really needs the context
16641664
from typing import List
16651665
def f(): pass
16661666
a = [0] if f() else [] # type: List[int]
1667-
a.append(0)
1667+
a() # E: List[int] not callable
16681668
[builtins fixtures/list.py]
16691669

16701670
[case testUnificationEmptySetLeft]
16711671
def f(): pass
16721672
a = set() if f() else {0}
1673-
a.add(0)
1673+
a() # E: Set[int] not callable
16741674
[builtins fixtures/set.py]
16751675

16761676
[case testUnificationEmptyDictLeft]
16771677
def f(): pass
16781678
a = {} if f() else {0: 0}
1679-
a.update({0: 0})
1679+
a() # E: Dict[int, int] not callable
16801680
[builtins fixtures/dict.py]
16811681

16821682
[case testUnificationEmptyDictRight]
16831683
def f(): pass
16841684
a = {0: 0} if f() else {}
1685-
a.update({0: 0})
1685+
a() # E: Dict[int, int] not callable
16861686
[builtins fixtures/dict.py]
16871687

16881688
[case testUnificationDictWithEmptyListLeft]
16891689
def f(): pass
16901690
a = {0: []} if f() else {0: [0]}
1691-
a.update({0: [0]})
1691+
a() # E: Dict[int, List[int]] not callable
16921692
[builtins fixtures/dict.py]
16931693

16941694
[case testUnificationDictWithEmptyListRight]
16951695
def f(): pass
16961696
a = {0: [0]} if f() else {0: []}
1697-
a.update({0: [0]})
1697+
a() # E: Dict[int, List[int]] not callable
16981698
[builtins fixtures/dict.py]

0 commit comments

Comments
 (0)