Skip to content

Commit

Permalink
apply_types=False as default in get_broker
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-frolov committed Oct 19, 2024
1 parent 598dc00 commit 53fe370
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/prometheus/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@pytest.mark.asyncio
class LocalPrometheusTestcase(BaseTestcaseConfig):
def get_broker(self, **kwargs):
def get_broker(self, apply_types=False, **kwargs):
raise NotImplementedError

def get_middleware(self, **kwargs):
Expand Down Expand Up @@ -66,7 +66,7 @@ async def test_metrics(
metrics_manager_mock = Mock()
middleware._metrics_manager = metrics_manager_mock

broker = self.get_broker(middlewares=(middleware,))
broker = self.get_broker(apply_types=True, middlewares=(middleware,))

args, kwargs = self.get_subscriber_params(queue)

Expand Down
6 changes: 3 additions & 3 deletions tests/prometheus/confluent/test_confluent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

@pytest.mark.confluent
class TestPrometheus(ConfluentTestcaseConfig, LocalPrometheusTestcase):
def get_broker(self, **kwargs):
return KafkaBroker(**kwargs)
def get_broker(self, apply_types=False, **kwargs):
return KafkaBroker(apply_types=apply_types, **kwargs)

def get_middleware(self, **kwargs):
return KafkaPrometheusMiddleware(**kwargs)
Expand All @@ -30,7 +30,7 @@ async def test_metrics_batch(
metrics_manager_mock = Mock()
middleware._metrics_manager = metrics_manager_mock

broker = self.get_broker(middlewares=(middleware,))
broker = self.get_broker(apply_types=True, middlewares=(middleware,))

args, kwargs = self.get_subscriber_params(queue, batch=True)
message = None
Expand Down
6 changes: 3 additions & 3 deletions tests/prometheus/kafka/test_kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

@pytest.mark.kafka
class TestPrometheus(LocalPrometheusTestcase):
def get_broker(self, **kwargs):
return KafkaBroker(**kwargs)
def get_broker(self, apply_types=False, **kwargs):
return KafkaBroker(apply_types=apply_types, **kwargs)

def get_middleware(self, **kwargs):
return KafkaPrometheusMiddleware(**kwargs)
Expand All @@ -29,7 +29,7 @@ async def test_metrics_batch(
metrics_manager_mock = Mock()
middleware._metrics_manager = metrics_manager_mock

broker = self.get_broker(middlewares=(middleware,))
broker = self.get_broker(apply_types=True, middlewares=(middleware,))

args, kwargs = self.get_subscriber_params(queue, batch=True)
message = None
Expand Down
6 changes: 3 additions & 3 deletions tests/prometheus/nats/test_nats.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def stream(queue):

@pytest.mark.nats
class TestPrometheus(LocalPrometheusTestcase):
def get_broker(self, **kwargs):
return NatsBroker(**kwargs)
def get_broker(self, apply_types=False, **kwargs):
return NatsBroker(apply_types=apply_types, **kwargs)

def get_middleware(self, **kwargs):
return NatsPrometheusMiddleware(**kwargs)
Expand All @@ -35,7 +35,7 @@ async def test_metrics_batch(
metrics_manager_mock = Mock()
middleware._metrics_manager = metrics_manager_mock

broker = self.get_broker(middlewares=(middleware,))
broker = self.get_broker(apply_types=True, middlewares=(middleware,))

args, kwargs = self.get_subscriber_params(
queue,
Expand Down
4 changes: 2 additions & 2 deletions tests/prometheus/rabbit/test_rabbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def exchange(queue):

@pytest.mark.rabbit
class TestPrometheus(LocalPrometheusTestcase):
def get_broker(self, **kwargs):
return RabbitBroker(**kwargs)
def get_broker(self, apply_types=False, **kwargs):
return RabbitBroker(apply_types=apply_types, **kwargs)

def get_middleware(self, **kwargs):
return RabbitPrometheusMiddleware(**kwargs)
Expand Down
6 changes: 3 additions & 3 deletions tests/prometheus/redis/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

@pytest.mark.redis
class TestPrometheus(LocalPrometheusTestcase):
def get_broker(self, **kwargs):
return RedisBroker(**kwargs)
def get_broker(self, apply_types=False, **kwargs):
return RedisBroker(apply_types=apply_types, **kwargs)

def get_middleware(self, **kwargs):
return RedisPrometheusMiddleware(**kwargs)
Expand All @@ -29,7 +29,7 @@ async def test_metrics_batch(
metrics_manager_mock = Mock()
middleware._metrics_manager = metrics_manager_mock

broker = self.get_broker(middlewares=(middleware,))
broker = self.get_broker(apply_types=True, middlewares=(middleware,))

args, kwargs = self.get_subscriber_params(list=ListSub(queue, batch=True))

Expand Down

0 comments on commit 53fe370

Please sign in to comment.