Skip to content

Commit

Permalink
Reconfigure tests for PyPy and 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
wbarnha committed Mar 8, 2024
1 parent 3923095 commit d432220
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/test_producer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gc
import platform
import sys
import time
import threading

Expand All @@ -21,8 +22,8 @@ def test_buffer_pool():
buf2 = pool.allocate(1000, 1000)
assert buf2.read() == b''


@pytest.mark.skipif(not env_kafka_version(), reason="No KAFKA_VERSION set")
@pytest.mark.skipif(env_kafka_version() <= (0, 8, 2) and sys.version_info > (3, 11), reason="Kafka 0.8.2 and earlier not supported by 3.12")
@pytest.mark.parametrize("compression", [None, 'gzip', 'snappy', 'lz4', 'zstd'])
def test_end_to_end(kafka_broker, compression):
if compression == 'lz4':
Expand Down Expand Up @@ -70,6 +71,7 @@ def test_end_to_end(kafka_broker, compression):

@pytest.mark.skipif(platform.python_implementation() != 'CPython',
reason='Test relies on CPython-specific gc policies')
@pytest.mark.skipif(env_kafka_version() <= (0, 8, 2) and sys.version_info > (3, 11), reason="Kafka 0.8.2 and earlier not supported by 3.12")
def test_kafka_producer_gc_cleanup():
gc.collect()
threads = threading.active_count()
Expand All @@ -81,6 +83,7 @@ def test_kafka_producer_gc_cleanup():


@pytest.mark.skipif(not env_kafka_version(), reason="No KAFKA_VERSION set")
@pytest.mark.skipif(env_kafka_version() <= (0, 8, 2) and sys.version_info > (3, 11), reason="Kafka 0.8.2 and earlier not supported by 3.12")
@pytest.mark.parametrize("compression", [None, 'gzip', 'snappy', 'lz4', 'zstd'])
def test_kafka_producer_proper_record_metadata(kafka_broker, compression):
if compression == 'zstd' and env_kafka_version() < (2, 1, 0):
Expand Down

0 comments on commit d432220

Please sign in to comment.