Skip to content

Commit 8bd59fd

Browse files
committed
Fix failing tests
1 parent 841d89a commit 8bd59fd

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# The test fixture will put the Apify SDK wheel path on the next line
22
APIFY_SDK_WHEEL_PLACEHOLDER
33
uvicorn[standard]
4-
crawlee[parsel] @ git+https://github.com/apify/crawlee-python.git@storage-clients-and-configurations
4+
crawlee[parsel] @ git+https://github.com/apify/crawlee-python.git@storage-clients-and-configurations-2

tests/unit/actor/test_actor_lifecycle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ async def handler(websocket: websockets.asyncio.server.ServerConnection) -> None
150150
port: int = ws_server.sockets[0].getsockname()[1] # type: ignore[index]
151151
monkeypatch.setenv(ActorEnvVars.EVENTS_WEBSOCKET_URL, f'ws://localhost:{port}')
152152

153+
# Make sure there is a charging manager that can be mocked
154+
Actor._get_charging_manager_implementation()
155+
153156
mock_run_client = Mock()
154157
mock_run_client.run.return_value.get = AsyncMock(
155158
side_effect=lambda: {

tests/unit/events/test_apify_event_manager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@
2222
from collections.abc import Callable
2323

2424

25-
@pytest.mark.skip(reason='There are issues with log propagation to caplog, see issue #462.')
2625
async def test_lifecycle_local(caplog: pytest.LogCaptureFixture) -> None:
2726
caplog.set_level(logging.DEBUG, logger='apify')
28-
config = Configuration.get_global_configuration()
2927

30-
async with ApifyEventManager(config):
28+
async with ApifyEventManager(Configuration()):
3129
pass
3230

3331
assert len(caplog.records) == 1

tests/unit/test_proxy_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,9 @@ async def test_initialize_when_status_page_unavailable(
539539

540540
await proxy_configuration.initialize()
541541

542-
assert len(caplog.records) == 1
542+
assert len(caplog.records) == 2
543543
assert caplog.records[0].levelname == 'WARNING'
544-
assert 'Apify Proxy access check timed out' in caplog.records[0].message
544+
assert 'Apify Proxy access check timed out' in caplog.records[1].message
545545

546546

547547
async def test_initialize_with_non_apify_proxy(

0 commit comments

Comments
 (0)