Skip to content

Commit

Permalink
Add 5.0.0b3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed May 9, 2023
1 parent 21d68bb commit 58c8d6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
matrix:
redis-image: [ "redis:6.2.12", "redis:7.0.11" ]
python-version: [ "3.7", "3.10" ]
redis-py: [ "4.3.6", "4.5.5" ]
redis-py: [ "4.3.6", "4.5.5" , "5.0.0b3"]
include:
- python-version: "3.11"
redis-image: "redis:6.2.12"
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Test without coverage
if: ${{ !matrix.coverage }}
run: |
run: |
poetry run pytest -v -m "not slow"
- name: Test with coverage
if: ${{ matrix.coverage }}
Expand Down
6 changes: 3 additions & 3 deletions fakeredis/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ def _decode(self, response):
else:
return response

def read_response(self, disable_decoding=False, disconnect_on_error=True):
def read_response(self, **kwargs):
if not self._server.connected:
try:
response = self._sock.responses.get_nowait()
except queue.Empty:
if disconnect_on_error:
if kwargs.get('disconnect_on_error', True):
self.disconnect()
raise redis.ConnectionError(msgs.CONNECTION_ERROR_MSG)
else:
response = self._sock.responses.get()
if isinstance(response, redis.ResponseError):
raise response
if disable_decoding:
if kwargs.get('disable_decoding', False):
return response
else:
return self._decode(response)
Expand Down

0 comments on commit 58c8d6e

Please sign in to comment.