Skip to content

Commit

Permalink
chore: fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
salman2013 committed Feb 20, 2024
1 parent 7d5e6a0 commit f89137f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions edx_event_bus_redis/internal/tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Tests for message module.
"""

import re
from datetime import datetime, timezone
from uuid import UUID
import re

import ddt
import pytest
from django.test import TestCase
Expand Down Expand Up @@ -69,16 +70,17 @@ def test_no_type(self):

def test_no_event_data(self):
msg = (
b'1',
b'1',
{
b'id': b'629f9892-c258-11ed-8dac-1c83413013cb',
b'id': b'629f9892-c258-11ed-8dac-1c83413013cb',
b'event_data': self.event_data_bytes,
}
)
with pytest.raises(UnusableMessageError) as excinfo:
RedisMessage.parse(msg, topic='some-local-topic')
expected_error_pattern = re.compile(
r"Error determining metadata from message headers: .*__init__\(\) missing 1 required positional argument: 'event_type'"
r"Error determining metadata from message headers: .*__init__\(\) "
r"missing 1 required positional argument: 'event_type'"
)
assert expected_error_pattern.search(str(excinfo.value)) is not None

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def check_name_consistent(package):
if seen_spelling is None:
by_canonical_name[canonical] = package
elif seen_spelling != package:
raise Exception(
raise Exception( # pylint: disable=broad-exception-raised
f'Encountered both "{seen_spelling}" and "{package}" in requirements '
'and constraints files; please use just one or the other.'
)
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ norecursedirs = .* docs requirements site-packages
[testenv]
deps =
django42: Django>=4.2,<5.0
setuptools
-r{toxinidir}/requirements/test.txt
commands =
python manage.py check
Expand Down Expand Up @@ -63,6 +64,7 @@ allowlist_externals =
rm
touch
deps =
setuptools
-r{toxinidir}/requirements/quality.txt
commands =
touch tests/__init__.py
Expand Down

0 comments on commit f89137f

Please sign in to comment.