Skip to content

Commit 36a1637

Browse files
committed
annotate functions in tests
1 parent 38337a8 commit 36a1637

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

test-data/unit/check-classes.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ A().f = None # E: Cannot assign to a method
122122
[case testReferToInvalidAttribute]
123123

124124
class A:
125-
def __init__(self):
125+
def __init__(self) -> None:
126126
self.x = object()
127127
a = None # type: A
128128
a.y

test-data/unit/check-inference.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ b[{}] = 1
14031403

14041404
[case testInferDictInitializedToEmptyAndUpdatedFromMethod]
14051405
map = {}
1406-
def add():
1406+
def add() -> None:
14071407
map[1] = 2
14081408
[builtins fixtures/dict.pyi]
14091409
[out]
@@ -1959,7 +1959,7 @@ class C:
19591959

19601960
if bool():
19611961
f()
1962-
1 + '' # E: Unsupported left operand type for + ("int")
1962+
1 + '' # E: Unsupported operand types for + ("int" and "str")
19631963
[builtins fixtures/list.pyi]
19641964
[out]
19651965

@@ -1976,7 +1976,7 @@ class C:
19761976

19771977
if bool():
19781978
f()
1979-
1 + '' # E: Unsupported left operand type for + ("int")
1979+
1 + '' # E: Unsupported operand types for + ("int" and "str")
19801980
[builtins fixtures/list.pyi]
19811981
[out]
19821982

@@ -1992,6 +1992,6 @@ class C:
19921992

19931993
if bool():
19941994
f([])
1995-
1 + '' # E: Unsupported left operand type for + ("int")
1995+
1 + '' # E: Unsupported operand types for + ("int" and "str")
19961996
[builtins fixtures/list.pyi]
19971997
[out]

test-data/unit/check-modules.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ class A:
13121312
def f(self) -> str: return 'foo'
13131313
class B(A):
13141314
def f(self) -> str: return self.x
1315-
def initialize(self): self.x = 'bar'
1315+
def initialize(self) -> None: self.x = 'bar'
13161316
[out]
13171317

13181318

test-data/unit/check-statements.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ a @= 1 # E: Argument 1 to "__imatmul__" of "A" has incompatible type "int"; exp
353353

354354
[case testInplaceSetitem]
355355
class A(object):
356-
def __init__(self):
356+
def __init__(self) -> None:
357357
self.a = 0
358358

359359
def __iadd__(self, a):

test-data/unit/fixtures/list.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class list(Generic[T]):
2626

2727
class tuple(Generic[T]): pass
2828
class function: pass
29-
class int: pass
29+
class int:
30+
def __add__(self, other: 'int') -> 'int': pass
3031
class float: pass
3132
class str: pass
3233
class bool(int): pass

0 commit comments

Comments
 (0)