Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import pytest

from test.fixtures import KafkaFixture, ZookeeperFixture
from test.testutil import kafka_version, random_string
from test.fixtures import KafkaFixture, ZookeeperFixture, random_string, version as kafka_version


@pytest.fixture(scope="module")
def version():
Expand Down
2 changes: 1 addition & 1 deletion test/test_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
lz4_encode_old_kafka, lz4_decode_old_kafka,
)

from test.testutil import random_string
from test.fixtures import random_string


def test_gzip():
Expand Down
2 changes: 1 addition & 1 deletion test/test_consumer_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from kafka.structs import TopicPartition

from test.conftest import version
from test.testutil import random_string
from test.fixtures import random_string


def get_connect_str(kafka_broker):
Expand Down
4 changes: 2 additions & 2 deletions test/test_consumer_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
)

from test.conftest import version
from test.fixtures import ZookeeperFixture, KafkaFixture
from test.fixtures import ZookeeperFixture, KafkaFixture, random_string
from test.testutil import (
KafkaIntegrationTestCase, kafka_versions, random_string, Timer,
KafkaIntegrationTestCase, kafka_versions, Timer,
send_messages
)

Expand Down
4 changes: 2 additions & 2 deletions test/test_failover_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from kafka.producer.base import Producer
from kafka.structs import TopicPartition

from test.fixtures import ZookeeperFixture, KafkaFixture
from test.testutil import KafkaIntegrationTestCase, random_string
from test.fixtures import ZookeeperFixture, KafkaFixture, random_string
from test.testutil import KafkaIntegrationTestCase


log = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion test/test_producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kafka import KafkaConsumer, KafkaProducer, TopicPartition
from kafka.producer.buffer import SimpleBufferPool
from test.conftest import version
from test.testutil import random_string
from test.fixtures import random_string


def test_buffer_pool():
Expand Down
7 changes: 1 addition & 6 deletions test/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from kafka.structs import OffsetRequestPayload, ProduceRequestPayload
from test.fixtures import random_string, version_str_to_list, version as kafka_version #pylint: disable=wrong-import-order


def kafka_versions(*versions):

def construct_lambda(s):
Expand Down Expand Up @@ -65,12 +66,6 @@ def wrapper(func, *args, **kwargs):

return real_kafka_versions

def get_open_port():
sock = socket.socket()
sock.bind(("", 0))
port = sock.getsockname()[1]
sock.close()
return port

_MESSAGES = {}
def msg(message):
Expand Down