File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 22from __future__ import absolute_import
33
44import io
5+ import platform
56
67import pytest
78
@@ -34,7 +35,8 @@ def test_buffer_close():
3435@pytest .mark .parametrize ('compression' , [
3536 'gzip' ,
3637 'snappy' ,
37- pytest .mark .skipif ("sys.version_info < (2,7)" )('lz4' ), # lz4tools does not work on py26
38+ pytest .mark .skipif (platform .python_implementation () == 'PyPy' ,
39+ reason = 'python-lz4 crashes on older versions of pypy' )('lz4' ),
3840])
3941def test_compressed_buffer_close (compression ):
4042 records = MessageSetBuffer (io .BytesIO (), 100000 , compression_type = compression )
Original file line number Diff line number Diff line change 1+ from __future__ import absolute_import
2+
3+ import platform
14import struct
25
36import pytest
@@ -80,7 +83,8 @@ def test_snappy_encode_xerial():
8083 assert compressed == to_ensure
8184
8285
83- @pytest .mark .skipif (not has_lz4 (), reason = "LZ4 not available" )
86+ @pytest .mark .skipif (not has_lz4 () or platform .python_implementation () == 'PyPy' ,
87+ reason = "python-lz4 crashes on old versions of pypy" )
8488def test_lz4 ():
8589 for i in xrange (1000 ):
8690 b1 = random_string (100 ).encode ('utf-8' )
@@ -89,7 +93,8 @@ def test_lz4():
8993 assert b1 == b2
9094
9195
92- @pytest .mark .skipif (not has_lz4 (), reason = "LZ4 not available" )
96+ @pytest .mark .skipif (not has_lz4 () or platform .python_implementation () == 'PyPy' ,
97+ reason = "python-lz4 crashes on old versions of pypy" )
9398def test_lz4_old ():
9499 for i in xrange (1000 ):
95100 b1 = random_string (100 ).encode ('utf-8' )
@@ -98,8 +103,8 @@ def test_lz4_old():
98103 assert b1 == b2
99104
100105
101- @pytest .mark .xfail ( reason = "lz4tools library doesnt support incremental decompression" )
102- @ pytest . mark . skipif ( not has_lz4 (), reason = "LZ4 not available " )
106+ @pytest .mark .skipif ( not has_lz4 () or platform . python_implementation () == 'PyPy' ,
107+ reason = "python-lz4 crashes on old versions of pypy " )
103108def test_lz4_incremental ():
104109 for i in xrange (1000 ):
105110 # lz4 max single block size is 4MB
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ def test_end_to_end(kafka_broker, compression):
3131 # LZ4 requires 0.8.2
3232 if version () < (0 , 8 , 2 ):
3333 return
34- # LZ4 python libs don't work on python2.6
35- elif sys . version_info < ( 2 , 7 ) :
34+ # python-lz4 crashes on older versions of pypy
35+ elif platform . python_implementation () == 'PyPy' :
3636 return
3737
3838 connect_str = 'localhost:' + str (kafka_broker .port )
You can’t perform that action at this time.
0 commit comments