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 2
2
from __future__ import absolute_import
3
3
4
4
import io
5
+ import platform
5
6
6
7
import pytest
7
8
@@ -34,7 +35,8 @@ def test_buffer_close():
34
35
@pytest .mark .parametrize ('compression' , [
35
36
'gzip' ,
36
37
'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' ),
38
40
])
39
41
def test_compressed_buffer_close (compression ):
40
42
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
1
4
import struct
2
5
3
6
import pytest
@@ -80,7 +83,8 @@ def test_snappy_encode_xerial():
80
83
assert compressed == to_ensure
81
84
82
85
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" )
84
88
def test_lz4 ():
85
89
for i in xrange (1000 ):
86
90
b1 = random_string (100 ).encode ('utf-8' )
@@ -89,7 +93,8 @@ def test_lz4():
89
93
assert b1 == b2
90
94
91
95
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" )
93
98
def test_lz4_old ():
94
99
for i in xrange (1000 ):
95
100
b1 = random_string (100 ).encode ('utf-8' )
@@ -98,8 +103,8 @@ def test_lz4_old():
98
103
assert b1 == b2
99
104
100
105
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 " )
103
108
def test_lz4_incremental ():
104
109
for i in xrange (1000 ):
105
110
# 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):
31
31
# LZ4 requires 0.8.2
32
32
if version () < (0 , 8 , 2 ):
33
33
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' :
36
36
return
37
37
38
38
connect_str = 'localhost:' + str (kafka_broker .port )
You can’t perform that action at this time.
0 commit comments