@@ -55,6 +55,7 @@ async def test_basic_response(self):
5555 assert resp .meta ["playwright_page" ].url == resp .url
5656 await resp .meta ["playwright_page" ].close ()
5757
58+ @allow_windows
5859 async def test_post_request (self ):
5960 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
6061 with MockServer () as server :
@@ -66,6 +67,7 @@ async def test_post_request(self):
6667 assert_correct_response (resp , req )
6768 assert "Request body: foo=bar" in resp .text
6869
70+ @allow_windows
6971 async def test_timeout_error (self ):
7072 settings_dict = {
7173 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -83,6 +85,7 @@ async def test_timeout_error(self):
8385 f" exc_type={ type (excinfo .value )} exc_msg={ str (excinfo .value )} " ,
8486 ) in self ._caplog .record_tuples
8587
88+ @allow_windows
8689 async def test_retry_page_content_still_navigating (self ):
8790 if self .browser_type != "chromium" :
8891 pytest .skip ("Only Chromium seems to redirect meta tags within the same goto call" )
@@ -104,6 +107,7 @@ async def test_retry_page_content_still_navigating(self):
104107 ) in self ._caplog .record_tuples
105108
106109 @patch ("scrapy_playwright.handler.logger" )
110+ @allow_windows
107111 async def test_route_continue_exception (self , logger ):
108112 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
109113 scrapy_request = Request (url = "https://example.org" , method = "GET" )
@@ -154,6 +158,7 @@ async def test_route_continue_exception(self, logger):
154158 with pytest .raises (PlaywrightError ):
155159 await req_handler (route , playwright_request )
156160
161+ @allow_windows
157162 async def test_event_handler_dialog_callable (self ):
158163 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
159164 with StaticMockServer () as server :
@@ -175,6 +180,7 @@ async def test_event_handler_dialog_callable(self):
175180
176181 assert spider .dialog_message == "foobar"
177182
183+ @allow_windows
178184 async def test_event_handler_dialog_str (self ):
179185 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
180186 with StaticMockServer () as server :
@@ -196,6 +202,7 @@ async def test_event_handler_dialog_str(self):
196202
197203 assert spider .dialog_message == "foobar"
198204
205+ @allow_windows
199206 async def test_event_handler_dialog_missing (self ):
200207 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
201208 with StaticMockServer () as server :
@@ -219,6 +226,7 @@ async def test_event_handler_dialog_missing(self):
219226 ) in self ._caplog .record_tuples
220227 assert getattr (spider , "dialog_message" , None ) is None
221228
229+ @allow_windows
222230 async def test_response_attributes (self ):
223231 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
224232 with MockServer () as server :
@@ -230,6 +238,7 @@ async def test_response_attributes(self):
230238
231239 assert response .ip_address == ip_address (server .address )
232240
241+ @allow_windows
233242 async def test_page_goto_kwargs_referer (self ):
234243 if self .browser_type != "chromium" :
235244 pytest .skip ("referer as goto kwarg seems to work only with chromium :shrug:" )
@@ -248,6 +257,7 @@ async def test_page_goto_kwargs_referer(self):
248257 headers = json .loads (response .css ("pre::text" ).get ())
249258 assert headers ["Referer" ] == fake_referer
250259
260+ @allow_windows
251261 async def test_navigation_returns_none (self ):
252262 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
253263 with MockServer ():
@@ -263,6 +273,7 @@ async def test_navigation_returns_none(self):
263273 assert not response .headers
264274 assert response .status == 200
265275
276+ @allow_windows
266277 async def test_abort_requests (self ):
267278 async def should_abort_request_async (request ):
268279 return request .resource_type == "image"
@@ -295,6 +306,7 @@ def should_abort_request_sync(request):
295306 assert handler .stats .get_value (f"{ resp_prefix } /resource_type/image" ) is None
296307 assert handler .stats .get_value (f"{ req_prefix } /aborted" ) == 3
297308
309+ @allow_windows
298310 async def test_page_initialization_ok (self ):
299311 async def init_page (page , _request ):
300312 await page .set_extra_http_headers ({"Extra-Header" : "Qwerty" })
@@ -315,6 +327,7 @@ async def init_page(page, _request):
315327 headers = {key .lower (): value for key , value in headers .items ()}
316328 assert headers ["extra-header" ] == "Qwerty"
317329
330+ @allow_windows
318331 async def test_page_initialization_fail (self ):
319332 async def init_page (page , _request , _missing ):
320333 await page .set_extra_http_headers ({"Extra-Header" : "Qwerty" })
@@ -341,6 +354,7 @@ async def init_page(page, _request, _missing):
341354 assert f"[Context=default] Page init callback exception for { req !r} " in entry [2 ]
342355 assert "init_page() missing 1 required positional argument: '_missing'" in entry [2 ]
343356
357+ @allow_windows
344358 async def test_redirect (self ):
345359 async with make_handler ({"PLAYWRIGHT_BROWSER_TYPE" : self .browser_type }) as handler :
346360 with MockServer () as server :
@@ -358,6 +372,7 @@ async def test_redirect(self):
358372 server .urljoin ("/redirect" ),
359373 ]
360374
375+ @allow_windows
361376 async def test_logging_record_spider (self ):
362377 """Make sure at least one log record has the spider as an attribute
363378 (records sent before opening the spider will not have it).
@@ -370,6 +385,7 @@ async def test_logging_record_spider(self):
370385
371386 assert any (getattr (rec , "spider" , None ) is spider for rec in self ._caplog .records )
372387
388+ @allow_windows
373389 async def test_download_file (self ):
374390 settings_dict = {
375391 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -385,6 +401,7 @@ async def test_download_file(self):
385401 assert response .body .startswith (b"%PDF-1.5" )
386402 assert handler .stats .get_value ("playwright/download_count" ) == 1
387403
404+ @allow_windows
388405 async def test_download_file_delay_ok (self ):
389406 settings_dict = {
390407 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -401,6 +418,7 @@ async def test_download_file_delay_ok(self):
401418 assert response .body .startswith (b"%PDF-1.5" )
402419 assert handler .stats .get_value ("playwright/download_count" ) == 1
403420
421+ @allow_windows
404422 async def test_download_file_delay_error (self ):
405423 settings_dict = {
406424 "PLAYWRIGHT_BROWSER_TYPE" : self .browser_type ,
@@ -421,6 +439,7 @@ async def test_download_file_delay_error(self):
421439 f" exc_type={ type (excinfo .value )} exc_msg={ str (excinfo .value )} " ,
422440 ) in self ._caplog .record_tuples
423441
442+ @allow_windows
424443 async def test_download_file_failure (self ):
425444 if self .browser_type != "chromium" :
426445 pytest .skip ()
0 commit comments