diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2019-08-22 21:14:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-22 21:14:37 -0700 |
commit | 61fa0b27685c2d4e67d1b6575ca6797f36eb1bfa (patch) | |
tree | 7e9ade5bae3b4b3172b39771e08eb6b7108092c8 /test/test_consumer_group.py | |
parent | 6e6d0cca5dbdf0a9ae3a032b6de08f9bbbf9606a (diff) | |
download | kafka-python-61fa0b27685c2d4e67d1b6575ca6797f36eb1bfa.tar.gz |
Convert remaining `KafkaConsumer` tests to `pytest` (#1886)
This makes it so the only remaining use of `unittest` is in the old
tests of the deprecated `Simple*` clients. All `KafkaConsumer` tests are
migrated to `pytest`.
I also had to bump the test iterations up on one of the tests, I think there was a race condition there that was more commonly hit under pytest , planning to cleanup that in a followup PR. See https://github.com/dpkp/kafka-python/pull/1886#discussion_r316860737 for details.
Diffstat (limited to 'test/test_consumer_group.py')
-rw-r--r-- | test/test_consumer_group.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test_consumer_group.py b/test/test_consumer_group.py index 3367617..58dc7eb 100644 --- a/test/test_consumer_group.py +++ b/test/test_consumer_group.py @@ -29,6 +29,7 @@ def test_consumer(kafka_broker, topic): assert consumer._client._conns[node_id].state is ConnectionStates.CONNECTED consumer.close() + @pytest.mark.skipif(not env_kafka_version(), reason="No KAFKA_VERSION set") def test_consumer_topics(kafka_broker, topic): consumer = KafkaConsumer(bootstrap_servers=get_connect_str(kafka_broker)) @@ -38,6 +39,7 @@ def test_consumer_topics(kafka_broker, topic): assert len(consumer.partitions_for_topic(topic)) > 0 consumer.close() + @pytest.mark.skipif(env_kafka_version() < (0, 9), reason='Unsupported Kafka Version') def test_group(kafka_broker, topic): num_partitions = 4 |