File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -350,10 +350,6 @@ async def _download_request_with_page(
350350 )
351351 request .meta ["download_latency" ] = time () - start_time
352352
353- if not request .meta .get ("playwright_include_page" ):
354- await page .close ()
355- self .stats .inc_value ("playwright/page_count/closed" )
356-
357353 server_ip_address = None
358354 with suppress (AttributeError , KeyError , TypeError , ValueError ):
359355 server_addr = await response .server_addr ()
@@ -362,6 +358,10 @@ async def _download_request_with_page(
362358 with suppress (AttributeError ):
363359 request .meta ["playwright_security_details" ] = await response .security_details ()
364360
361+ if not request .meta .get ("playwright_include_page" ):
362+ await page .close ()
363+ self .stats .inc_value ("playwright/page_count/closed" )
364+
365365 body , encoding = _encode_body (headers = headers , text = body_str )
366366 respcls = responsetypes .from_args (headers = headers , url = page .url , body = body )
367367 return respcls (
Original file line number Diff line number Diff line change 77 pytest_asyncio ==0.21.1
88 pytest_cov ==4.1.0
99 pytest_twisted ==1.14
10- playwright ==1.36.0
1110commands =
1211 playwright install
1312 py.test -vv --reactor =asyncio \
You can’t perform that action at this time.
0 commit comments