Skip to content

Commit

Permalink
Add test for multi target
Browse files Browse the repository at this point in the history
  • Loading branch information
qdegraaf committed Nov 9, 2023
1 parent 65858f3 commit ea27432
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ async def func():

sleep(0) # TRIO115

x, y = 0, 2000
trio.sleep(x) # TRIO115
trio.sleep(y) # OK


trio.sleep(0) # TRIO115

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ TRIO115.py:18:5: TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.s
17 |
18 | sleep(0) # TRIO115
| ^^^^^^^^ TRIO115
19 |
20 | x, y = 0, 2000
|
= help: Replace with `trio.lowlevel.checkpoint()`

Expand All @@ -79,39 +81,58 @@ TRIO115.py:18:5: TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.s
18 |- sleep(0) # TRIO115
18 |+ trio.lowlevel.checkpoint # TRIO115
19 19 |
20 20 |
21 21 | trio.sleep(0) # TRIO115
20 20 | x, y = 0, 2000
21 21 | trio.sleep(x) # TRIO115

TRIO115.py:21:1: TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
TRIO115.py:21:5: TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
|
21 | trio.sleep(0) # TRIO115
| ^^^^^^^^^^^^^ TRIO115
20 | x, y = 0, 2000
21 | trio.sleep(x) # TRIO115
| ^^^^^^^^^^^^^ TRIO115
22 | trio.sleep(y) # OK
|
= help: Replace with `trio.lowlevel.checkpoint()`

Fix
18 18 | sleep(0) # TRIO115
19 19 |
20 20 |
21 |-trio.sleep(0) # TRIO115
21 |+trio.lowlevel.checkpoint # TRIO115
22 22 |
20 20 | x, y = 0, 2000
21 |- trio.sleep(x) # TRIO115
21 |+ trio.lowlevel.checkpoint # TRIO115
22 22 | trio.sleep(y) # OK
23 23 |
24 24 | def func():
24 24 |

TRIO115.py:25:14: TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
TRIO115.py:25:1: TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
|
24 | def func():
25 | trio.run(trio.sleep(0)) # TRIO115
| ^^^^^^^^^^^^^ TRIO115
25 | trio.sleep(0) # TRIO115
| ^^^^^^^^^^^^^ TRIO115
|
= help: Replace with `trio.lowlevel.checkpoint()`

Fix
22 22 |
22 22 | trio.sleep(y) # OK
23 23 |
24 24 | def func():
25 |- trio.run(trio.sleep(0)) # TRIO115
25 |+ trio.run(trio.lowlevel.checkpoint) # TRIO115
24 24 |
25 |-trio.sleep(0) # TRIO115
25 |+trio.lowlevel.checkpoint # TRIO115
26 26 |
27 27 |
28 28 | def func():

TRIO115.py:29:14: TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
|
28 | def func():
29 | trio.run(trio.sleep(0)) # TRIO115
| ^^^^^^^^^^^^^ TRIO115
|
= help: Replace with `trio.lowlevel.checkpoint()`

Fix
26 26 |
27 27 |
28 28 | def func():
29 |- trio.run(trio.sleep(0)) # TRIO115
29 |+ trio.run(trio.lowlevel.checkpoint) # TRIO115


0 comments on commit ea27432

Please sign in to comment.