Skip to content

Commit

Permalink
test_state: close StateManagerRedis connection in test to avoid warning
Browse files Browse the repository at this point in the history
  • Loading branch information
masenf committed Oct 7, 2024
1 parent 4919191 commit ebd2e69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/units/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2793,6 +2793,9 @@ async def test_preprocess(app_module_mock, token, test_state, expected, mocker):
}
assert (await state._process(events[1]).__anext__()).delta == exp_is_hydrated(state)

if isinstance(app.state_manager, StateManagerRedis):
await app.state_manager.close()


@pytest.mark.asyncio
async def test_preprocess_multiple_load_events(app_module_mock, token, mocker):
Expand Down Expand Up @@ -2840,6 +2843,9 @@ async def test_preprocess_multiple_load_events(app_module_mock, token, mocker):
}
assert (await state._process(events[2]).__anext__()).delta == exp_is_hydrated(state)

if isinstance(app.state_manager, StateManagerRedis):
await app.state_manager.close()


@pytest.mark.asyncio
async def test_get_state(mock_app: rx.App, token: str):
Expand Down

0 comments on commit ebd2e69

Please sign in to comment.