diff --git a/edx_event_bus_redis/internal/tests/test_message.py b/edx_event_bus_redis/internal/tests/test_message.py index 35a9b0d..4def225 100644 --- a/edx_event_bus_redis/internal/tests/test_message.py +++ b/edx_event_bus_redis/internal/tests/test_message.py @@ -4,7 +4,7 @@ from datetime import datetime, timezone from uuid import UUID - +import re import ddt import pytest from django.test import TestCase @@ -77,10 +77,10 @@ def test_no_event_data(self): ) with pytest.raises(UnusableMessageError) as excinfo: RedisMessage.parse(msg, topic='some-local-topic') - #import pdb; pdb.set_trace() - assert excinfo.value.args == ( - "Error determining metadata from message headers: EventsMetadata.__init__() missing 1 required positional argument: 'event_type'", + expected_error_pattern = re.compile( + r"Error determining metadata from message headers: .*__init__\(\) missing 1 required positional argument: 'event_type'" ) + assert expected_error_pattern.search(str(excinfo.value)) is not None def test_bad_msg(self): """