Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dev = [
"pytest-timeout~=2.4.0",
"pytest-xdist~=3.8.0",
"pytest~=8.4.0",
"ruff~=0.12.0",
"ruff~=0.13.0",
"setuptools", # setuptools are used by pytest but not explicitly required
"types-cachetools~=6.2.0.20250827",
"uvicorn[standard]",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/events/test_apify_event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def test_lifecycle_on_platform_without_websocket(monkeypatch: pytest.Monke
monkeypatch.setenv(ActorEnvVars.EVENTS_WEBSOCKET_URL, 'ws://localhost:56565')
event_manager = ApifyEventManager(Configuration.get_global_configuration())

with pytest.raises(RuntimeError, match='Error connecting to platform events websocket!'):
with pytest.raises(RuntimeError, match=r'Error connecting to platform events websocket!'):
async with event_manager:
pass

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scrapy/extensions/test_httpcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ def test_get_kvs_name(spider_name: str, expected: str) -> None:
],
)
def test_get_kvs_name_raises(spider_name: str) -> None:
with pytest.raises(ValueError, match='Unsupported spider name'):
with pytest.raises(ValueError, match=r'Unsupported spider name'):
assert get_kvs_name(spider_name)
4 changes: 2 additions & 2 deletions tests/unit/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_decryption_fails_with_invalid_password() -> None:
encrypted = public_encrypt(test_value, public_key=PUBLIC_KEY)
encrypted['encrypted_password'] = base64.b64encode(b'invalid_password').decode('utf-8')

with pytest.raises(ValueError, match='Ciphertext length must be equal to key size.'):
with pytest.raises(ValueError, match=r'Ciphertext length must be equal to key size.'):
private_decrypt(**encrypted, private_key=PRIVATE_KEY)


Expand All @@ -79,7 +79,7 @@ def test_decryption_fails_with_manipulated_cipher() -> None:
b'invalid_cipher' + base64.b64decode(encrypted['encrypted_value'].encode('utf-8')),
).decode('utf-8')

with pytest.raises(ValueError, match='Decryption failed, malformed encrypted value or password.'):
with pytest.raises(ValueError, match=r'Decryption failed, malformed encrypted value or password.'):
private_decrypt(**encrypted, private_key=PRIVATE_KEY)


Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_proxy_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ def test_invalid_arguments() -> None:
with pytest.raises(ValueError, match=match_pattern):
ProxyConfiguration(country_code=invalid_country_code) # type: ignore[arg-type]

with pytest.raises(ValueError, match='Exactly one of .* must be specified'):
with pytest.raises(ValueError, match=r'Exactly one of .* must be specified'):
ProxyConfiguration(
proxy_urls=['http://proxy.com:1111'],
new_url_function=lambda session_id=None, request=None: 'http://proxy.com:2222',
)

with pytest.raises(ValueError, match='Cannot combine custom proxies with Apify Proxy'):
with pytest.raises(ValueError, match=r'Cannot combine custom proxies with Apify Proxy'):
ProxyConfiguration(proxy_urls=['http://proxy.com:1111'], groups=['GROUP1'])

with pytest.raises(ValueError, match=re.escape('bad-url')):
ProxyConfiguration(proxy_urls=['bad-url'])

with pytest.raises(ValueError, match='Cannot combine custom proxies with Apify Proxy'):
with pytest.raises(ValueError, match=r'Cannot combine custom proxies with Apify Proxy'):
ProxyConfiguration(
new_url_function=lambda session_id=None, request=None: 'http://proxy.com:2222', groups=['GROUP1']
)
Expand Down Expand Up @@ -241,7 +241,7 @@ def custom_new_url_function(session_id: str | None = None, request: Any = None)

proxy_configuration = ProxyConfiguration(new_url_function=custom_new_url_function)

with pytest.raises(ValueError, match='The provided "new_url_function" did not return a valid URL'):
with pytest.raises(ValueError, match=r'The provided "new_url_function" did not return a valid URL'):
await proxy_configuration.new_url()


Expand Down Expand Up @@ -416,7 +416,7 @@ def request_handler(request: Request, response: Response) -> Response:
async def test_initialize_without_password_or_token() -> None:
proxy_configuration = ProxyConfiguration()

with pytest.raises(ValueError, match='Apify Proxy password must be provided'):
with pytest.raises(ValueError, match=r'Apify Proxy password must be provided'):
await proxy_configuration.initialize()


Expand Down
46 changes: 23 additions & 23 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading