Skip to content

Commit d02f8fc

Browse files
committed
Resolve failing unittest
1 parent 126d632 commit d02f8fc

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

redis/asyncio/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ async def send_packed_command(
917917
raise ConnectionError(
918918
f"Error {err_no} while writing to socket. {errmsg}."
919919
) from e
920-
except BaseException:
920+
except Exception:
921921
await self.disconnect()
922922
raise
923923

@@ -960,7 +960,7 @@ async def read_response(self, disable_decoding: bool = False):
960960
raise ConnectionError(
961961
f"Error while reading from {self.host}:{self.port} : {e.args}"
962962
)
963-
except BaseException:
963+
except Exception:
964964
await self.disconnect()
965965
raise
966966

@@ -992,7 +992,7 @@ async def read_response_without_lock(self, disable_decoding: bool = False):
992992
raise ConnectionError(
993993
f"Error while reading from {self.host}:{self.port} : {e.args}"
994994
)
995-
except BaseException:
995+
except Exception:
996996
await self.disconnect()
997997
raise
998998

redis/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ def send_packed_command(self, command, check_health=True):
800800
errno = e.args[0]
801801
errmsg = e.args[1]
802802
raise ConnectionError(f"Error {errno} while writing to socket. {errmsg}.")
803-
except BaseException:
803+
except Exception:
804804
self.disconnect()
805805
raise
806806

@@ -838,7 +838,7 @@ def read_response(self, disable_decoding=False):
838838
except OSError as e:
839839
self.disconnect()
840840
raise ConnectionError(f"Error while reading from {hosterr}" f" : {e.args}")
841-
except BaseException:
841+
except Exception:
842842
self.disconnect()
843843
raise
844844

tests/test_asyncio/test_pubsub.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,6 @@ async def loop_step_listen(self):
918918
return False
919919

920920

921-
@pytest.mark.xfail
922921
@pytest.mark.onlynoncluster
923922
class TestBaseException:
924923
@pytest.mark.skipif(

tests/test_pubsub.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,6 @@ def loop_step_listen(self):
737737
return True
738738

739739

740-
@pytest.mark.xfail
741740
@pytest.mark.onlynoncluster
742741
class TestBaseException:
743742
def test_base_exception(self, r: redis.Redis):

0 commit comments

Comments
 (0)