Skip to content

Commit 18192ed

Browse files
committed
fix test files matching literals to async function return value, which mypy now correctly marks as unreachable
1 parent bd08af1 commit 18192ed

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/autofix_files/async91x_autofix.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async def match_subject() -> None:
156156
async def match_not_all_cases() -> ( # ASYNC910: 0, "exit", Statement("function definition", lineno)
157157
None
158158
):
159-
match foo():
159+
match bar():
160160
case 1:
161161
...
162162
case _:
@@ -203,7 +203,7 @@ async def match_all_cases() -> None:
203203
async def match_fallback_await_in_guard() -> None:
204204
# The case guard is only executed if the pattern matches, so we can mostly treat
205205
# it as part of the body, except for a special case for fallback+checkpointing guard.
206-
match foo():
206+
match bar():
207207
case 1 if await foo():
208208
...
209209
case _ if await foo():
@@ -212,7 +212,7 @@ async def match_fallback_await_in_guard() -> None:
212212

213213
async def match_checkpoint_guard() -> None:
214214
# The above pattern is quite cursed, but this seems fairly reasonable to do.
215-
match foo():
215+
match bar():
216216
case 1 if await foo():
217217
...
218218
case _:
@@ -222,7 +222,7 @@ async def match_checkpoint_guard() -> None:
222222
async def match_not_checkpoint_in_all_guards() -> ( # ASYNC910: 0, "exit", Statement("function definition", lineno)
223223
None
224224
):
225-
match foo():
225+
match bar():
226226
case 1:
227227
...
228228
case _ if await foo():

tests/eval_files/async91x_autofix.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async def match_subject() -> None:
140140
async def match_not_all_cases() -> ( # ASYNC910: 0, "exit", Statement("function definition", lineno)
141141
None
142142
):
143-
match foo():
143+
match bar():
144144
case 1:
145145
...
146146
case _:
@@ -184,7 +184,7 @@ async def match_all_cases() -> None:
184184
async def match_fallback_await_in_guard() -> None:
185185
# The case guard is only executed if the pattern matches, so we can mostly treat
186186
# it as part of the body, except for a special case for fallback+checkpointing guard.
187-
match foo():
187+
match bar():
188188
case 1 if await foo():
189189
...
190190
case _ if await foo():
@@ -193,7 +193,7 @@ async def match_fallback_await_in_guard() -> None:
193193

194194
async def match_checkpoint_guard() -> None:
195195
# The above pattern is quite cursed, but this seems fairly reasonable to do.
196-
match foo():
196+
match bar():
197197
case 1 if await foo():
198198
...
199199
case _:
@@ -203,7 +203,7 @@ async def match_checkpoint_guard() -> None:
203203
async def match_not_checkpoint_in_all_guards() -> ( # ASYNC910: 0, "exit", Statement("function definition", lineno)
204204
None
205205
):
206-
match foo():
206+
match bar():
207207
case 1:
208208
...
209209
case _ if await foo():

0 commit comments

Comments
 (0)