Skip to content

Commit 2eac82d

Browse files
committed
Lint & format
Signed-off-by: Federico Busetti <[email protected]>
1 parent 73f6a6d commit 2eac82d

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

tests/common/test_dramatiq.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from unittest.mock import patch, MagicMock
2-
from dramatiq.encoder import DecodeError
3-
from dramatiq import get_broker, get_encoder
4-
from dramatiq.brokers.stub import StubBroker
1+
from unittest.mock import MagicMock, patch
52

6-
import pytest
73
import orjson
4+
import pytest
5+
from dramatiq import get_broker, get_encoder
6+
from dramatiq.brokers.stub import StubBroker
7+
from dramatiq.encoder import DecodeError
88

99
from common import AppConfig
1010
from common.config import DramatiqConfig
@@ -27,7 +27,10 @@ def test_orjson_encoder(
2727
mocked_loads.assert_called_once_with(b"serialized")
2828

2929

30-
@patch("common.dramatiq.orjson.loads", side_effect=orjson.JSONDecodeError("msg","doc", 123))
30+
@patch(
31+
"common.dramatiq.orjson.loads",
32+
side_effect=orjson.JSONDecodeError("msg", "doc", 123),
33+
)
3134
def test_orjson_encoder_fails(
3235
mocked_loads: MagicMock,
3336
):
@@ -60,6 +63,10 @@ def test_init_dramatiq_with_redis():
6063

6164
def test_init_dramatiq_without_redis_url():
6265
"""Test if an exception is raised when in non-test environment without Redis URL."""
63-
config = AppConfig(ENVIRONMENT="production", DRAMATIQ=DramatiqConfig(REDIS_URL=None)) # Mock config
64-
with pytest.raises(RuntimeError, match="Running a non-test environment without Redis URL set"):
65-
init_dramatiq(config)
66+
config = AppConfig(
67+
ENVIRONMENT="production", DRAMATIQ=DramatiqConfig(REDIS_URL=None)
68+
) # Mock config
69+
with pytest.raises(
70+
RuntimeError, match="Running a non-test environment without Redis URL set"
71+
):
72+
init_dramatiq(config)

0 commit comments

Comments
 (0)