Skip to content

Commit 3b7634a

Browse files
committed
Update caplog test
1 parent 698c089 commit 3b7634a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/unit/test_proxy_configuration.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ async def test_initialize_when_not_connected(monkeypatch: pytest.MonkeyPatch, ht
523523
async def test_initialize_when_status_page_unavailable(
524524
monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture, httpserver: HTTPServer
525525
) -> None:
526+
caplog.set_level('WARNING')
526527
dummy_proxy_status_url = str(httpserver.url_for('/')).removesuffix('/')
527528
monkeypatch.setenv(ApifyEnvVars.PROXY_STATUS_URL.value, dummy_proxy_status_url)
528529

@@ -532,9 +533,10 @@ async def test_initialize_when_status_page_unavailable(
532533

533534
await proxy_configuration.initialize()
534535

535-
assert len(caplog.records) == 2
536-
assert caplog.records[0].levelname == 'WARNING'
537-
assert 'Apify Proxy access check timed out' in caplog.records[1].message
536+
assert (
537+
'Apify Proxy access check timed out. Watch out for errors with status code 407. If you see some, it most likely'
538+
' means you do not have access to either all or some of the proxies you are trying to use.'
539+
) in caplog.messages
538540

539541

540542
async def test_initialize_with_non_apify_proxy(

0 commit comments

Comments
 (0)