Skip to content

Commit

Permalink
Remove unused fixtures
Browse files Browse the repository at this point in the history
These fixtures and helper functions were either unused or easily replaced.
  • Loading branch information
jeffwidman committed Oct 29, 2018
1 parent ca00436 commit 3e332e8
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions test/test_consumer_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest
from kafka.vendor import six

from kafka import SimpleClient
from kafka.conn import ConnectionStates
from kafka.consumer.group import KafkaConsumer
from kafka.coordinator.base import MemberState, Generation
Expand All @@ -20,25 +19,10 @@ def get_connect_str(kafka_broker):
return kafka_broker.host + ':' + str(kafka_broker.port)


@pytest.fixture
def simple_client(kafka_broker):
return SimpleClient(get_connect_str(kafka_broker))


@pytest.fixture
def topic(simple_client):
topic = random_string(5)
simple_client.ensure_topic_exists(topic)
return topic


@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
def test_consumer(kafka_broker, version):

def test_consumer(kafka_broker, topic, version):
# The `topic` fixture is included because
# 0.8.2 brokers need a topic to function well
if version >= (0, 8, 2) and version < (0, 9):
topic(simple_client(kafka_broker))

consumer = KafkaConsumer(bootstrap_servers=get_connect_str(kafka_broker))
consumer.poll(500)
assert len(consumer._client._conns) > 0
Expand Down

0 comments on commit 3e332e8

Please sign in to comment.