MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_get_session

Function test_get_session

tests/unit/sessions/test_session_pool.py:75–83  ·  view source on GitHub ↗

Check retrieval of a session from the pool and verify its properties.

(session_pool: SessionPool)

Source from the content-addressed store, hash-verified

73
74
75async def test_get_session(session_pool: SessionPool) -> None:
76 """Check retrieval of a session from the pool and verify its properties."""
77 session = await session_pool.get_session()
78 assert session is not None
79 assert session.expires_at >= datetime.now(timezone.utc)
80 assert not session.is_blocked
81 assert not session.is_expired
82 assert not session.is_max_usage_count_reached
83 assert session.is_usable
84
85
86async def test_get_session_no_usable(caplog: pytest.LogCaptureFixture, session_pool: SessionPool) -> None:

Callers

nothing calls this directly

Calls 1

get_sessionMethod · 0.45

Tested by

no test coverage detected