Skip to content

Commit

Permalink
fixs connection mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
dvora-h committed Jan 7, 2024
1 parent be39f47 commit 583ac94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ def _gen_cluster_mock_resp(r, response):
connection = Mock(spec=Connection)
connection.retry = Retry(NoBackoff(), 0)
connection.read_response.return_value = response
connection._get_from_local_cache.return_value = None
with mock.patch.object(r, "connection", connection):
yield r

Expand Down
1 change: 1 addition & 0 deletions tests/test_asyncio/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def _gen_cluster_mock_resp(r, response):
connection = mock.AsyncMock(spec=Connection)
connection.retry = Retry(NoBackoff(), 0)
connection.read_response.return_value = response
connection.read_response.return_value = response
with mock.patch.object(r, "connection", connection):
yield r

Expand Down

0 comments on commit 583ac94

Please sign in to comment.