@@ -41,7 +41,6 @@ def inject_fixtures(self, caplog):
4141 caplog .set_level (logging .DEBUG )
4242 self ._caplog = caplog
4343
44- @pytest .mark .asyncio
4544 async def test_basic_response (self ):
4645 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
4746 with StaticMockServer () as server :
@@ -53,10 +52,8 @@ async def test_basic_response(self):
5352 assert resp .css ("a::text" ).getall () == ["Lorem Ipsum" , "Infinite Scroll" ]
5453 assert isinstance (resp .meta ["playwright_page" ], PlaywrightPage )
5554 assert resp .meta ["playwright_page" ].url == resp .url
56-
5755 await resp .meta ["playwright_page" ].close ()
5856
59- @pytest .mark .asyncio
6057 async def test_post_request (self ):
6158 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
6259 with MockServer () as server :
@@ -68,7 +65,6 @@ async def test_post_request(self):
6865 assert_correct_response (resp , req )
6966 assert "Request body: foo=bar" in resp .text
7067
71- @pytest .mark .asyncio
7268 async def test_timeout_error (self ):
7369 settings_dict = {
7470 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -86,7 +82,6 @@ async def test_timeout_error(self):
8682 f" exc_type={ type (excinfo .value )} exc_msg={ str (excinfo .value )} " ,
8783 ) in self ._caplog .record_tuples
8884
89- @pytest .mark .asyncio
9085 async def test_retry_page_content_still_navigating (self ):
9186 if self .browser_type != "chromium" :
9287 pytest .skip ("Only Chromium seems to redirect meta tags within the same goto call" )
@@ -108,7 +103,6 @@ async def test_retry_page_content_still_navigating(self):
108103 ) in self ._caplog .record_tuples
109104
110105 @patch ("scrapy_playwright.handler.logger" )
111- @pytest .mark .asyncio
112106 async def test_route_continue_exception (self , logger ):
113107 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
114108 scrapy_request = Request (url = "https://example.org" , method = "GET" )
@@ -159,7 +153,6 @@ async def test_route_continue_exception(self, logger):
159153 with pytest .raises (PlaywrightError ):
160154 await req_handler (route , playwright_request )
161155
162- @pytest .mark .asyncio
163156 async def test_event_handler_dialog_callable (self ):
164157 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
165158 with StaticMockServer () as server :
@@ -181,7 +174,6 @@ async def test_event_handler_dialog_callable(self):
181174
182175 assert spider .dialog_message == "foobar"
183176
184- @pytest .mark .asyncio
185177 async def test_event_handler_dialog_str (self ):
186178 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
187179 with StaticMockServer () as server :
@@ -203,7 +195,6 @@ async def test_event_handler_dialog_str(self):
203195
204196 assert spider .dialog_message == "foobar"
205197
206- @pytest .mark .asyncio
207198 async def test_event_handler_dialog_missing (self ):
208199 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
209200 with StaticMockServer () as server :
@@ -227,7 +218,6 @@ async def test_event_handler_dialog_missing(self):
227218 ) in self ._caplog .record_tuples
228219 assert getattr (spider , "dialog_message" , None ) is None
229220
230- @pytest .mark .asyncio
231221 async def test_response_attributes (self ):
232222 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
233223 with MockServer () as server :
@@ -239,7 +229,6 @@ async def test_response_attributes(self):
239229
240230 assert response .ip_address == ip_address (server .address )
241231
242- @pytest .mark .asyncio
243232 async def test_page_goto_kwargs_referer (self ):
244233 if self .browser_type != "chromium" :
245234 pytest .skip ("referer as goto kwarg seems to work only with chromium :shrug:" )
@@ -258,7 +247,6 @@ async def test_page_goto_kwargs_referer(self):
258247 headers = json .loads (response .css ("pre::text" ).get ())
259248 assert headers ["Referer" ] == fake_referer
260249
261- @pytest .mark .asyncio
262250 async def test_navigation_returns_none (self ):
263251 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
264252 with MockServer ():
@@ -274,7 +262,6 @@ async def test_navigation_returns_none(self):
274262 assert not response .headers
275263 assert response .status == 200
276264
277- @pytest .mark .asyncio
278265 async def test_abort_requests (self ):
279266 async def should_abort_request_async (request ):
280267 return request .resource_type == "image"
@@ -307,7 +294,6 @@ def should_abort_request_sync(request):
307294 assert handler .stats .get_value (f"{ resp_prefix } /resource_type/image" ) is None
308295 assert handler .stats .get_value (f"{ req_prefix } /aborted" ) == 3
309296
310- @pytest .mark .asyncio
311297 async def test_page_initialization_ok (self ):
312298 async def init_page (page , _request ):
313299 await page .set_extra_http_headers ({"Extra-Header" : "Qwerty" })
@@ -328,7 +314,6 @@ async def init_page(page, _request):
328314 headers = {key .lower (): value for key , value in headers .items ()}
329315 assert headers ["extra-header" ] == "Qwerty"
330316
331- @pytest .mark .asyncio
332317 async def test_page_initialization_fail (self ):
333318 async def init_page (page , _request , _missing ):
334319 await page .set_extra_http_headers ({"Extra-Header" : "Qwerty" })
@@ -355,7 +340,6 @@ async def init_page(page, _request, _missing):
355340 assert f"[Context=default] Page init callback exception for { req !r} " in entry [2 ]
356341 assert "init_page() missing 1 required positional argument: '_missing'" in entry [2 ]
357342
358- @pytest .mark .asyncio
359343 async def test_redirect (self ):
360344 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
361345 with MockServer () as server :
@@ -373,7 +357,6 @@ async def test_redirect(self):
373357 server .urljoin ("/redirect" ),
374358 ]
375359
376- @pytest .mark .asyncio
377360 async def test_logging_record_spider (self ):
378361 """Make sure at least one log record has the spider as an attribute
379362 (records sent before opening the spider will not have it).
@@ -386,7 +369,6 @@ async def test_logging_record_spider(self):
386369
387370 assert any (getattr (rec , "spider" , None ) is spider for rec in self ._caplog .records )
388371
389- @pytest .mark .asyncio
390372 async def test_download_file (self ):
391373 settings_dict = {
392374 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -402,7 +384,6 @@ async def test_download_file(self):
402384 assert response .body .startswith (b"%PDF-1.5" )
403385 assert handler .stats .get_value ("playwright/download_count" ) == 1
404386
405- @pytest .mark .asyncio
406387 async def test_download_file_delay_ok (self ):
407388 settings_dict = {
408389 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -419,7 +400,6 @@ async def test_download_file_delay_ok(self):
419400 assert response .body .startswith (b"%PDF-1.5" )
420401 assert handler .stats .get_value ("playwright/download_count" ) == 1
421402
422- @pytest .mark .asyncio
423403 async def test_download_file_delay_error (self ):
424404 settings_dict = {
425405 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -440,7 +420,6 @@ async def test_download_file_delay_error(self):
440420 f" exc_type={ type (excinfo .value )} exc_msg={ str (excinfo .value )} " ,
441421 ) in self ._caplog .record_tuples
442422
443- @pytest .mark .asyncio
444423 async def test_download_file_failure (self ):
445424 if self .browser_type != "chromium" :
446425 pytest .skip ()
0 commit comments