From ff7c34c2531b963ddbcd96cdc6a076fdea3b0526 Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 19 Feb 2024 19:53:29 +0500 Subject: [PATCH] chore: fix tests for 3.11 and 3.12 --- edx_event_bus_redis/internal/tests/test_message.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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): """