MCPcopy
hub / github.com/microsoft/playwright-python / AsyncEventContextManager

Class AsyncEventContextManager

playwright/_impl/_async_base.py:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43
44class AsyncEventContextManager(Generic[T], AbstractAsyncContextManager):
45 def __init__(self, future: "asyncio.Future[T]") -> None:
46 self._event = AsyncEventInfo[T](future)
47
48 async def __aenter__(self) -> AsyncEventInfo[T]:
49 return self._event
50
51 async def __aexit__(
52 self,
53 exc_type: Optional[Type[BaseException]],
54 exc_val: Optional[BaseException],
55 exc_tb: Optional[TracebackType],
56 ) -> None:
57 if exc_val:
58 self._event._cancel()
59 else:
60 await self._event.value
61
62
63class AsyncBase(ImplWrapper):

Callers 15

expect_eventMethod · 0.90
expect_navigationMethod · 0.90
expect_eventMethod · 0.90
expect_eventMethod · 0.90
expect_downloadMethod · 0.90
expect_file_chooserMethod · 0.90
expect_navigationMethod · 0.90
expect_popupMethod · 0.90
expect_requestMethod · 0.90
expect_responseMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected