Skip to content

Commit 2d71f81

Browse files
committed
Change tests where the lines might differ or errors could be optional
1 parent 0151347 commit 2d71f81

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

conformance/tests/annotations_generators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ def generator7() -> Iterator[dict[str, int]]:
8484

8585

8686
def generator8() -> int: # E: incompatible return type
87-
yield None # E
87+
yield None # E? error was already raised above
8888
return 0
8989

9090

9191
async def generator9() -> int: # E: incompatible return type
92-
yield None # E
92+
yield None # E? error was already raised above
9393

9494

9595
class IntIterator(Protocol):

conformance/tests/classes_classvar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class ClassA(Generic[T, P]):
6363
good4: ClassVar = 3.1
6464
# > If the `ClassVar` qualifier is used without any assigned value, the type
6565
# > should be inferred as `Any`:
66-
good5: ClassVar #E? Type checkers may error on uninitialized ClassVar
66+
good5: ClassVar # E?: Type checkers may error on uninitialized ClassVar
6767
good6: Annotated[ClassVar[list[int]], ""] = []
6868

6969
def method1(self, a: ClassVar[int]): # E: ClassVar not allowed here

conformance/tests/overloads_definitions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def final_method(self, x: int | str) -> int | str: ...
119119
# The @final decorator should not be on one of the overloads:
120120

121121
@overload # E[invalid_final] @final should be on implementation only
122-
@final
122+
@final # E[invalid_final]
123123
def invalid_final(self, x: int) -> int: # E[invalid_final]
124124
...
125125

conformance/tests/overloads_definitions_stub.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Base:
6969
def invalid_final(self, x: int) -> int: # E[invalid_final]
7070
...
7171
@overload # E[invalid_final]
72-
@final
72+
@final # E[invalid_final]
7373
def invalid_final(self, x: str) -> str: # E[invalid_final]
7474
...
7575
@overload
@@ -82,7 +82,7 @@ class Base:
8282
def invalid_final_2(self, x: int) -> int: # E[invalid_final_2]
8383
...
8484
@overload # E[invalid_final_2]
85-
@final
85+
@final # E[invalid_final_2]
8686
def invalid_final_2(self, x: str) -> str: ... # E[invalid_final_2]
8787

8888
# These methods are just here for the @override test below. We use an
@@ -143,7 +143,7 @@ class Child(Base): # E[override-final]
143143
@overload # E[override_impl]: @override should appear only on first overload
144144
def to_override(self, x: int) -> int: ...
145145
@overload
146-
@override
146+
@override # E[override_impl]: @override should appear only on first overload
147147
def to_override( # E[override_impl]: @override should appear only on first overload
148148
self, x: str
149149
) -> str: # E[override_impl]: @override should appear only on first overload

conformance/tests/qualifiers_annotated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ class ClassC(TypedDict):
116116
TA1: TypeAlias = Annotated[int | str, ""]
117117
TA2 = Annotated[Literal[1, 2], ""]
118118

119-
T = TypeVar("T")
119+
T = TypeVar("T") # E?: T is already defined
120120

121121
TA3 = Annotated[T, ""]

conformance/tests/typeddicts_alt_syntax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242

4343
movie2: Movie2
4444
movie2 = {"name": "Blade Runner", "year": 1982} # E?: May generate errors if keyword-argument syntax is unsupported
45-
movie2 = {"name": "Blade Runner", "year": ""} # E: Incorrect type for year
45+
movie2 = {"name": "Blade Runner", "year": ""} # E?: Incorrect type for year

0 commit comments

Comments
 (0)