File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -468,8 +468,10 @@ async def wait_for_refresh(self) -> bool:
468468 due to calling it within the node's own task.
469469
470470 """
471-
472- if self ._task is None or asyncio .current_task () is self ._task :
471+ assert (
472+ self ._task is not None
473+ ), "Node must be running before calling wait_for_refresh"
474+ if asyncio .current_task () is self ._task :
473475 return False
474476 refreshed_event = asyncio .Event ()
475477 self .call_after_refresh (refreshed_event .set )
Original file line number Diff line number Diff line change @@ -434,6 +434,7 @@ async def _post_mouse_events(
434434 widget_at = None
435435 for chain in range (1 , times + 1 ):
436436 for mouse_event_cls in events :
437+ await self .pause ()
437438 # Get the widget under the mouse before the event because the app might
438439 # react to the event and move things around. We override on each iteration
439440 # because we assume the final event in `events` is the actual event we care
@@ -453,8 +454,8 @@ async def _post_mouse_events(
453454 # we patch the offset in there as well.
454455 app .mouse_position = offset
455456 screen ._forward_event (event )
456- await self .pause ()
457457
458+ await self .pause ()
458459 return widget is None or widget_at is target_widget
459460
460461 async def _wait_for_screen (self , timeout : float = 30.0 ) -> bool :
You can’t perform that action at this time.
0 commit comments