Skip to content

Commit 2bb618f

Browse files
committed
Resolve failing unittest
1 parent 6990428 commit 2bb618f

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
@@ -906,7 +906,7 @@ async def send_packed_command(
906906
raise ConnectionError(
907907
f"Error {err_no} while writing to socket. {errmsg}."
908908
) from e
909-
except BaseException:
909+
except Exception:
910910
await self.disconnect()
911911
raise
912912

@@ -949,7 +949,7 @@ async def read_response(self, disable_decoding: bool = False):
949949
raise ConnectionError(
950950
f"Error while reading from {self.host}:{self.port} : {e.args}"
951951
)
952-
except BaseException:
952+
except Exception:
953953
await self.disconnect()
954954
raise
955955

@@ -981,7 +981,7 @@ async def read_response_without_lock(self, disable_decoding: bool = False):
981981
raise ConnectionError(
982982
f"Error while reading from {self.host}:{self.port} : {e.args}"
983983
)
984-
except BaseException:
984+
except Exception:
985985
await self.disconnect()
986986
raise
987987

redis/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def send_packed_command(self, command, check_health=True):
790790
errno = e.args[0]
791791
errmsg = e.args[1]
792792
raise ConnectionError(f"Error {errno} while writing to socket. {errmsg}.")
793-
except BaseException:
793+
except Exception:
794794
self.disconnect()
795795
raise
796796

@@ -828,7 +828,7 @@ def read_response(self, disable_decoding=False):
828828
except OSError as e:
829829
self.disconnect()
830830
raise ConnectionError(f"Error while reading from {hosterr}" f" : {e.args}")
831-
except BaseException:
831+
except Exception:
832832
self.disconnect()
833833
raise
834834

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)