Skip to content

Commit ecfd228

Browse files
authored
Merge pull request #212 from justmobilize/exception-test-updates
Update test exceptions
2 parents cbe2177 + 1037c14 commit ecfd228

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def connect(
424424
)
425425
self._reset_reconnect_backoff()
426426
return ret
427-
except RuntimeError as e:
427+
except (MemoryError, OSError, RuntimeError) as e:
428428
self.logger.warning(f"Socket error when connecting: {e}")
429429
backoff = False
430430
except MMQTTException as e:

tests/test_port_ssl.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ def test_tls_without_ssl_context(self) -> None:
120120
connect_retries=1,
121121
)
122122

123-
with pytest.raises(AttributeError) as context:
123+
with pytest.raises(ValueError) as context:
124124
mqtt_client.connect()
125-
assert "ssl_context must be set" in str(context)
125+
assert "ssl_context must be provided if using ssl" in str(context)

0 commit comments

Comments
 (0)