MCPcopy
hub / github.com/psf/requests-html / test_async_render

Function test_async_render

tests/test_requests_html.py:198–215  ·  view source on GitHub ↗
(async_get)

Source from the content-addressed store, hash-verified

196@pytest.mark.render
197@pytest.mark.asyncio
198async def test_async_render(async_get):
199 r = await async_get()
200 script = """
201 () => {
202 return {
203 width: document.documentElement.clientWidth,
204 height: document.documentElement.clientHeight,
205 deviceScaleFactor: window.devicePixelRatio,
206 }
207 }
208 """
209 val = await r.html.arender(script=script)
210 for value in ('width', 'height', 'deviceScaleFactor'):
211 assert value in val
212
213 about = r.html.find('#about', first=True)
214 assert len(about.links) == 6
215 await r.html.browser.close()
216
217
218@pytest.mark.render

Callers

nothing calls this directly

Calls 4

async_getFunction · 0.85
arenderMethod · 0.80
findMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…