MCPcopy Index your code
hub / github.com/microsoft/playwright-python / test_connection_task_cancel

Function test_connection_task_cancel

tests/async/test_issues.py:40–55  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

38
39
40async def test_connection_task_cancel(page: Page) -> None:
41 await page.set_content("<input />")
42 done, pending = await wait(
43 {
44 create_task(page.wait_for_selector("input")),
45 create_task(page.wait_for_selector("#will-never-resolve")),
46 },
47 return_when=FIRST_COMPLETED,
48 )
49 assert len(done) == 1
50 assert len(pending) == 1
51 for task in pending:
52 task.cancel()
53 with pytest.raises(CancelledError):
54 await task
55 assert list(pending)[0].cancelled()

Callers

nothing calls this directly

Calls 3

set_contentMethod · 0.45
wait_for_selectorMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected