Skip to content

Commit 0c5679a

Browse files
committed
Resolve failing unittest
1 parent a13b28c commit 0c5679a

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

redis/asyncio/connection.py

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

@@ -958,7 +958,7 @@ async def read_response(self, disable_decoding: bool = False):
958958
raise ConnectionError(
959959
f"Error while reading from {self.host}:{self.port} : {e.args}"
960960
)
961-
except BaseException:
961+
except Exception:
962962
await self.disconnect()
963963
raise
964964

redis/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def send_packed_command(self, command, check_health=True):
766766
errno = e.args[0]
767767
errmsg = e.args[1]
768768
raise ConnectionError(f"Error {errno} while writing to socket. {errmsg}.")
769-
except BaseException:
769+
except Exception:
770770
self.disconnect()
771771
raise
772772

@@ -804,7 +804,7 @@ def read_response(self, disable_decoding=False):
804804
except OSError as e:
805805
self.disconnect()
806806
raise ConnectionError(f"Error while reading from {hosterr}" f" : {e.args}")
807-
except BaseException:
807+
except Exception:
808808
self.disconnect()
809809
raise
810810

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)