@@ -40,16 +40,6 @@ async def proxy(proxy_info: ProxyInfo) -> AsyncGenerator[ProxyInfo, None]:
4040 yield proxy_info
4141
4242
43- async def test_proxy (proxy : ProxyInfo , httpbin : str ) -> None :
44- client = HttpxClient ()
45- request = Request (url = f'{ httpbin } /status/222' , unique_key = '42' , id = '42' , user_data = {})
46-
47- async with Statistics () as statistics :
48- result = await client .crawl (request , None , proxy , statistics )
49-
50- assert result .http_response .status_code == 222
51-
52-
5343@pytest .fixture ()
5444async def disabled_proxy (proxy_info : ProxyInfo ) -> AsyncGenerator [ProxyInfo , None ]:
5545 with Proxy (
@@ -66,6 +56,17 @@ async def disabled_proxy(proxy_info: ProxyInfo) -> AsyncGenerator[ProxyInfo, Non
6656 yield proxy_info
6757
6858
59+ @pytest .mark .skipif (os .name == 'nt' , reason = 'Skipped on Windows' )
60+ async def test_proxy (proxy : ProxyInfo , httpbin : str ) -> None :
61+ client = HttpxClient ()
62+ request = Request (url = f'{ httpbin } /status/222' , unique_key = '42' , id = '42' , user_data = {})
63+
64+ async with Statistics () as statistics :
65+ result = await client .crawl (request , None , proxy , statistics )
66+
67+ assert result .http_response .status_code == 222
68+
69+
6970@pytest .mark .skipif (os .name == 'nt' , reason = 'Skipped on Windows' )
7071async def test_proxy_disabled (disabled_proxy : ProxyInfo , httpbin : str ) -> None :
7172 client = HttpxClient ()
0 commit comments