@@ -88,19 +88,19 @@ def test_invalid_arguments() -> None:
88
88
with pytest .raises (ValueError , match = match_pattern ):
89
89
ProxyConfiguration (country_code = invalid_country_code ) # type: ignore[arg-type]
90
90
91
- with pytest .raises (ValueError , match = 'Exactly one of .* must be specified' ):
91
+ with pytest .raises (ValueError , match = r 'Exactly one of .* must be specified' ):
92
92
ProxyConfiguration (
93
93
proxy_urls = ['http://proxy.com:1111' ],
94
94
new_url_function = lambda session_id = None , request = None : 'http://proxy.com:2222' ,
95
95
)
96
96
97
- with pytest .raises (ValueError , match = 'Cannot combine custom proxies with Apify Proxy' ):
97
+ with pytest .raises (ValueError , match = r 'Cannot combine custom proxies with Apify Proxy' ):
98
98
ProxyConfiguration (proxy_urls = ['http://proxy.com:1111' ], groups = ['GROUP1' ])
99
99
100
100
with pytest .raises (ValueError , match = re .escape ('bad-url' )):
101
101
ProxyConfiguration (proxy_urls = ['bad-url' ])
102
102
103
- with pytest .raises (ValueError , match = 'Cannot combine custom proxies with Apify Proxy' ):
103
+ with pytest .raises (ValueError , match = r 'Cannot combine custom proxies with Apify Proxy' ):
104
104
ProxyConfiguration (
105
105
new_url_function = lambda session_id = None , request = None : 'http://proxy.com:2222' , groups = ['GROUP1' ]
106
106
)
@@ -241,7 +241,7 @@ def custom_new_url_function(session_id: str | None = None, request: Any = None)
241
241
242
242
proxy_configuration = ProxyConfiguration (new_url_function = custom_new_url_function )
243
243
244
- with pytest .raises (ValueError , match = 'The provided "new_url_function" did not return a valid URL' ):
244
+ with pytest .raises (ValueError , match = r 'The provided "new_url_function" did not return a valid URL' ):
245
245
await proxy_configuration .new_url ()
246
246
247
247
@@ -416,7 +416,7 @@ def request_handler(request: Request, response: Response) -> Response:
416
416
async def test_initialize_without_password_or_token () -> None :
417
417
proxy_configuration = ProxyConfiguration ()
418
418
419
- with pytest .raises (ValueError , match = 'Apify Proxy password must be provided' ):
419
+ with pytest .raises (ValueError , match = r 'Apify Proxy password must be provided' ):
420
420
await proxy_configuration .initialize ()
421
421
422
422
0 commit comments