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

Function test_add_session

tests/unit/sessions/test_session_pool.py:50–58  ·  view source on GitHub ↗

Test adding sessions to the session pool increases session counts appropriately.

(session_pool: SessionPool)

Source from the content-addressed store, hash-verified

48
49
50async def test_add_session(session_pool: SessionPool) -> None:
51 """Test adding sessions to the session pool increases session counts appropriately."""
52 session_01 = Session(id='test_session_01')
53 session_02 = Session(id='test_session_02')
54 session_pool.add_session(session=session_01)
55 session_pool.add_session(session=session_02)
56 assert session_pool.session_count == MAX_POOL_SIZE + 2
57 assert session_pool.usable_session_count == MAX_POOL_SIZE + 2
58 assert session_pool.retired_session_count == 0
59
60
61async def test_add_session_duplicate(caplog: pytest.LogCaptureFixture, session_pool: SessionPool) -> None:

Callers

nothing calls this directly

Calls 2

SessionClass · 0.90
add_sessionMethod · 0.80

Tested by

no test coverage detected