From d3529ba79501d0721478e8e79ac6279724949262 Mon Sep 17 00:00:00 2001 From: Felix Bohn Date: Tue, 14 Feb 2023 08:21:47 +0100 Subject: [PATCH] #823: fix unexpected --- tavern/_plugins/mqtt/response.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tavern/_plugins/mqtt/response.py b/tavern/_plugins/mqtt/response.py index fb3f7029a..a8471baae 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"):