Skip to content

Commit 5bdb420

Browse files
committed
Improved tests
1 parent 9c0f526 commit 5bdb420

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from typing import AsyncGenerator
3+
from uuid import uuid4
34

45
import pytest
56
from aiokafka import AIOKafkaConsumer, AIOKafkaProducer
@@ -35,7 +36,7 @@ def base_topic_name() -> str:
3536
3637
:returns: topic name.
3738
"""
38-
return "taskiq_topic"
39+
return uuid4().hex
3940

4041

4142
@pytest.fixture()
@@ -134,8 +135,8 @@ async def broker(
134135
bootstrap_servers=kafka_url,
135136
aiokafka_producer=test_kafka_producer,
136137
aiokafka_consumer=test_kafka_consumer,
137-
delete_topic_on_shutdown=True,
138138
kafka_topic=base_topic,
139+
delete_topic_on_shutdown=True,
139140
)
140141
broker.is_worker_process = True
141142

tests/test_broker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async def test_startup(
7373
str
7474
] = broker_without_arguments._kafka_admin_client.list_topics() # noqa: WPS437
7575

76-
assert base_topic_name in all_kafka_topics
76+
assert broker_without_arguments._kafka_topic.name in all_kafka_topics
7777

7878

7979
@pytest.mark.anyio

0 commit comments

Comments
 (0)