Skip to content

Commit c46760e

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

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
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: 1 addition & 1 deletion
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]

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)