Verify that adding a duplicate session logs a warning and does not increase count.
(caplog: pytest.LogCaptureFixture, session_pool: SessionPool)
| 59 | |
| 60 | |
| 61 | async def test_add_session_duplicate(caplog: pytest.LogCaptureFixture, session_pool: SessionPool) -> None: |
| 62 | """Verify that adding a duplicate session logs a warning and does not increase count.""" |
| 63 | session_01 = Session(id='test_session_01') |
| 64 | session_02 = Session(id='test_session_01') |
| 65 | |
| 66 | session_pool.add_session(session=session_01) |
| 67 | assert session_pool.session_count == MAX_POOL_SIZE + 1 |
| 68 | |
| 69 | with caplog.at_level(logging.WARNING): |
| 70 | session_pool.add_session(session=session_02) |
| 71 | |
| 72 | assert session_pool.session_count == MAX_POOL_SIZE + 1 |
| 73 | |
| 74 | |
| 75 | async def test_get_session(session_pool: SessionPool) -> None: |
nothing calls this directly
no test coverage detected