Skip to content

Commit 970d81c

Browse files
committed
stop test_cancel_sleep from deadlocking and less dependent on timer
No need for `raise Exception` because we already assert the flag. fixes #103
1 parent 5006bee commit 970d81c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/test_misc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,10 @@ async def test_cancel_sleep(self, loop):
154154
def do_not_run():
155155
nonlocal owch
156156
owch = 1
157-
raise Exception("should not run")
158157

159158
async def cancel_sleep():
160159
h = loop.call_later(0.2, do_not_run)
161-
await asyncio.sleep(0.1)
160+
await asyncio.sleep(0.01)
162161
h.cancel()
163162
await asyncio.sleep(0.3)
164163

0 commit comments

Comments
 (0)