We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 024444e commit 162afd7Copy full SHA for 162afd7
1 file changed
playwright/sync_api/_context_manager.py
@@ -98,5 +98,8 @@ def __exit__(self, *args: Any) -> None:
98
if self._watcher:
99
self._watcher.close()
100
if self._own_loop:
101
+ tasks = asyncio.all_tasks(self._loop)
102
+ for t in [t for t in tasks if not (t.done() or t.cancelled())]:
103
+ t.cancel()
104
self._loop.run_until_complete(self._loop.shutdown_asyncgens())
105
self._loop.close()
0 commit comments