Skip to content

Commit

Permalink
soften the comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Dec 12, 2022
1 parent fd4eb21 commit 46d26c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/test_asyncio/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ async def test_read_response__interrupt_does_not_corrupt(exc_type):

with pytest.raises(exc_type):
await conn.send_command("EXISTS non_existent_key")
# due to the interrupt, the integer '0' result of EXISTS will remain on the socket's buffer
# due to the interrupt, the integer '0' result of EXISTS will remain
# on the socket's buffer
with patch.object(socket.socket, "recv", side_effect=exc_type) as mock_recv:
await conn.read_response()
mock_recv.assert_called_once()
Expand Down
8 changes: 2 additions & 6 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,8 @@ def test_read_response__interrupt_does_not_corrupt(self, exc_type):
# asyncio.exceptions.CancelledError also derives from BaseException
# for same reason.
#
# The notion that one should never `expect:` or `expect BaseException`,
# however, is misguided. It's idiomatic to handle it, to provide
# for exception safety, as long as you re-raise.
#
# with gevent.Timeout(5):
# res = client.exists('my_key')
# What we should ensure, one way or another, is that the connection is
# not left in a corrupted state.

conn.send_command("GET non_existent_key")
resp = conn.read_response()
Expand Down

0 comments on commit 46d26c0

Please sign in to comment.