Skip to content

Commit

Permalink
Merge pull request #212 from justmobilize/exception-test-updates
Browse files Browse the repository at this point in the history
Update test exceptions
  • Loading branch information
dhalbert authored May 12, 2024
2 parents cbe2177 + 1037c14 commit ecfd228
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adafruit_minimqtt/adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def connect(
)
self._reset_reconnect_backoff()
return ret
except RuntimeError as e:
except (MemoryError, OSError, RuntimeError) as e:
self.logger.warning(f"Socket error when connecting: {e}")
backoff = False
except MMQTTException as e:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_port_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ def test_tls_without_ssl_context(self) -> None:
connect_retries=1,
)

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

0 comments on commit ecfd228

Please sign in to comment.