diff --git a/tavern/_plugins/mqtt/response.py b/tavern/_plugins/mqtt/response.py index fb3f7029..a8471baa 100644 --- a/tavern/_plugins/mqtt/response.py +++ b/tavern/_plugins/mqtt/response.py @@ -208,11 +208,12 @@ def _await_messages_on_topic( if verifiers: for v in verifiers: - self._adderr( - "Expected '%s' on topic '%s' but no such message received", - v.expected_payload, - topic, - ) + if not v.expected.get("unexpected"): + self._adderr( + "Expected '%s' on topic '%s' but no such message received", + v.expected_payload, + topic, + ) for msg in correct_messages: if msg.expected.get("unexpected"):