|
9 | 9 | import trio as noterror
|
10 | 10 |
|
11 | 11 | # error
|
12 |
| -with trio.open_nursery() as n: # error: 5, "n" |
| 12 | +with trio.open_nursery() as n: # error: 5, "n", "nursery" |
13 | 13 | n.start(...)
|
14 | 14 |
|
15 |
| -with trio.open_nursery(...) as nurse: # error: 5, "nurse" |
| 15 | +with trio.open_nursery(...) as nurse: # error: 5, "nurse", "nursery" |
16 | 16 | nurse.start_soon(...)
|
17 | 17 |
|
18 |
| -with trio.open_nursery() as n: # error: 5, "n" |
| 18 | +with trio.open_nursery() as n: # error: 5, "n", "nursery" |
19 | 19 | n.start_soon(n=7)
|
20 | 20 |
|
21 | 21 |
|
22 | 22 | async def foo():
|
23 |
| - async with trio.open_nursery() as n: # error: 15, "n" |
| 23 | + async with trio.open_nursery() as n: # error: 15, "n", "nursery" |
24 | 24 | n.start(...)
|
25 | 25 |
|
26 | 26 |
|
27 | 27 | # weird ones with multiple `withitem`s
|
28 | 28 | # but if split among several `with` they'd all be treated as error (or ASYNC111), so
|
29 | 29 | # treating as error for now.
|
30 |
| -with trio.open_nursery() as n, trio.open("") as n: # error: 5, "n" |
| 30 | +with trio.open_nursery() as n, trio.open("") as n: # error: 5, "n", "nursery" |
31 | 31 | n.start(...)
|
32 | 32 |
|
33 |
| -with open("") as o, trio.open_nursery() as n: # error: 20, "n" |
| 33 | +with open("") as o, trio.open_nursery() as n: # error: 20, "n", "nursery" |
34 | 34 | n.start(o)
|
35 | 35 |
|
36 |
| -with trio.open_nursery() as n, trio.open_nursery() as nurse: # error: 31, "nurse" |
| 36 | +with trio.open_nursery() as n, trio.open_nursery() as nurse: # error: 31, "nurse", "nursery" |
37 | 37 | nurse.start(n.start(...))
|
38 | 38 |
|
39 |
| -with trio.open_nursery() as n, trio.open_nursery() as n: # error: 5, "n" # error: 31, "n" |
| 39 | +with trio.open_nursery() as n, trio.open_nursery() as n: # error: 5, "n", "nursery" # error: 31, "n", "nursery" |
40 | 40 | n.start(...)
|
41 | 41 |
|
42 | 42 | # safe if passing variable as parameter
|
@@ -83,7 +83,7 @@ async def foo():
|
83 | 83 |
|
84 | 84 | # body is a call to await n.start
|
85 | 85 | async def foo_1():
|
86 |
| - with trio.open_nursery(...) as n: # error: 9, "n" |
| 86 | + with trio.open_nursery(...) as n: # error: 9, "n", "nursery" |
87 | 87 | await n.start(...)
|
88 | 88 |
|
89 | 89 |
|
|
0 commit comments