Skip to content

Commit 9772b5c

Browse files
committed
fix linters and failed tests
1 parent 688ad57 commit 9772b5c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

redis/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ def read_response(
15391539

15401540
# Cache only responses that still valid
15411541
# and wasn't invalidated by another connection in meantime.
1542-
if cache_entry is self._current_command_cache_entry:
1542+
if cache_entry is not None:
15431543
cache_entry.status = CacheEntryStatus.VALID
15441544
cache_entry.cache_value = response
15451545
self._cache.set(cache_entry)

tests/test_connection.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ def test_read_response_returns_cached_reply(self, mock_cache, mock_connection):
482482

483483
mock_cache.is_cachable.return_value = True
484484
mock_cache.get.side_effect = [
485-
None,
486485
None,
487486
CacheEntry(
488487
cache_key=CacheKey(
@@ -570,11 +569,6 @@ def test_read_response_returns_cached_reply(self, mock_cache, mock_connection):
570569
command="GET", redis_keys=("foo",), redis_args=("GET", "foo")
571570
)
572571
),
573-
call(
574-
CacheKey(
575-
command="GET", redis_keys=("foo",), redis_args=("GET", "foo")
576-
)
577-
),
578572
]
579573
)
580574

@@ -730,4 +724,4 @@ def test_cache_entry_fill_between_send_and_read(
730724

731725
assert proxy_connection.read_response() == b"bar2"
732726
mock_connection.send_command.assert_called_once()
733-
mock_connection.read_response.assert_called_once()
727+
mock_connection.read_response.assert_called_once()

0 commit comments

Comments
 (0)