Skip to content

Commit 001033c

Browse files
committed
Adapt snapshot tests
1 parent 1e926ea commit 001033c

5 files changed

+8
-8
lines changed

crates/red_knot_python_semantic/resources/mdtest/loops/for.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def _(flag: bool):
321321
# TODO... `int` might be ideal here?
322322
reveal_type(x) # revealed: int | Unknown
323323

324-
# error: [not-iterable] "Object of type `Iterable2` may not be iterable because its `__iter__` attribute (with type `Literal[__iter__] | None`) may not be callable"
324+
# error: [not-iterable] "Object of type `Iterable2` may not be iterable because its `__iter__` attribute (with type `<bound method `__iter__` of `Iterable2`> | None`) may not be callable"
325325
for y in Iterable2():
326326
# TODO... `int` might be ideal here?
327327
reveal_type(y) # revealed: int | Unknown

crates/red_knot_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly-not-callable_`__getitem__`_method.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ error: lint:not-iterable
7878
|
7979
26 | # error: [not-iterable]
8080
27 | for y in Iterable2():
81-
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because it has no `__iter__` method and its `__getitem__` attribute (with type `Literal[__getitem__] | None`) may not be callable
81+
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because it has no `__iter__` method and its `__getitem__` attribute (with type `<bound method `__getitem__` of `Iterable2`> | None`) may not be callable
8282
28 | # TODO... `int` might be ideal here?
8383
29 | reveal_type(y) # revealed: int | Unknown
8484
|

crates/red_knot_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__getitem__`_methods.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ error: lint:not-iterable
4848
|
4949
19 | # error: [not-iterable]
5050
20 | for x in Iterable1():
51-
| ^^^^^^^^^^^ Object of type `Iterable1` may not be iterable because it has no `__iter__` method and its `__getitem__` attribute (with type `Literal[__getitem__] | None`) may not be callable
51+
| ^^^^^^^^^^^ Object of type `Iterable1` may not be iterable because it has no `__iter__` method and its `__getitem__` attribute (with type `<bound method `__getitem__` of `Iterable1`> | None`) may not be callable
5252
21 | # TODO: `str` might be better
5353
22 | reveal_type(x) # revealed: str | Unknown
5454
|
@@ -75,7 +75,7 @@ error: lint:not-iterable
7575
|
7676
24 | # error: [not-iterable]
7777
25 | for y in Iterable2():
78-
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because it has no `__iter__` method and its `__getitem__` method (with type `Literal[__getitem__, __getitem__]`) may have an incorrect signature for the old-style iteration protocol (expected a signature at least as permissive as `def __getitem__(self, key: int): ...`)
78+
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because it has no `__iter__` method and its `__getitem__` method (with type `<bound method `__getitem__` of `Iterable2`> | <bound method `__getitem__` of `Iterable2`>`) may have an incorrect signature for the old-style iteration protocol (expected a signature at least as permissive as `def __getitem__(self, key: int): ...`)
7979
26 | reveal_type(y) # revealed: str | int
8080
|
8181

crates/red_knot_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__iter__`_methods.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ error: lint:not-iterable
5252
|
5353
16 | # error: [not-iterable]
5454
17 | for x in Iterable1():
55-
| ^^^^^^^^^^^ Object of type `Iterable1` may not be iterable because its `__iter__` method (with type `Literal[__iter__, __iter__]`) may have an invalid signature (expected `def __iter__(self): ...`)
55+
| ^^^^^^^^^^^ Object of type `Iterable1` may not be iterable because its `__iter__` method (with type `<bound method `__iter__` of `Iterable1`> | <bound method `__iter__` of `Iterable1`>`) may have an invalid signature (expected `def __iter__(self): ...`)
5656
18 | reveal_type(x) # revealed: int
5757
|
5858
@@ -78,7 +78,7 @@ error: lint:not-iterable
7878
|
7979
27 | # error: [not-iterable]
8080
28 | for x in Iterable2():
81-
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because its `__iter__` attribute (with type `Literal[__iter__] | None`) may not be callable
81+
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because its `__iter__` attribute (with type `<bound method `__iter__` of `Iterable2`> | None`) may not be callable
8282
29 | # TODO: `int` would probably be better here:
8383
30 | reveal_type(x) # revealed: int | Unknown
8484
|

crates/red_knot_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_invalid_`__getitem__`.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ error: lint:not-iterable
5959
|
6060
30 | # error: [not-iterable]
6161
31 | for x in Iterable1():
62-
| ^^^^^^^^^^^ Object of type `Iterable1` may not be iterable because it may not have an `__iter__` method and its `__getitem__` attribute (with type `Literal[__getitem__] | None`) may not be callable
62+
| ^^^^^^^^^^^ Object of type `Iterable1` may not be iterable because it may not have an `__iter__` method and its `__getitem__` attribute (with type `<bound method `__getitem__` of `Iterable1`> | None`) may not be callable
6363
32 | # TODO: `bytes | str` might be better
6464
33 | reveal_type(x) # revealed: bytes | str | Unknown
6565
|
@@ -86,7 +86,7 @@ error: lint:not-iterable
8686
|
8787
35 | # error: [not-iterable]
8888
36 | for y in Iterable2():
89-
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because it may not have an `__iter__` method and its `__getitem__` method (with type `Literal[__getitem__, __getitem__]`)
89+
| ^^^^^^^^^^^ Object of type `Iterable2` may not be iterable because it may not have an `__iter__` method and its `__getitem__` method (with type `<bound method `__getitem__` of `Iterable2`> | <bound method `__getitem__` of `Iterable2`>`)
9090
may have an incorrect signature for the old-style iteration protocol (expected a signature at least as permissive as `def __getitem__(self, key: int): ...`)
9191
37 | reveal_type(y) # revealed: bytes | str | int
9292
|

0 commit comments

Comments
 (0)