summaryrefslogtreecommitdiff
path: root/test/test_codec.py
diff options
context:
space:
mode:
authorJeff Widman <jeff@jeffwidman.com>2018-10-22 01:24:50 -0700
committerJeff Widman <jeff@jeffwidman.com>2018-10-22 14:30:33 -0700
commitb83feeca2ec6f6ad745fb7ea47c6484304bb55d8 (patch)
tree7580e387521b388f3af629b9d25278faa26ee349 /test/test_codec.py
parenta6be21e7b3a20ce2e25ef26140c43b59cc356f38 (diff)
downloadkafka-python-b83feeca2ec6f6ad745fb7ea47c6484304bb55d8.tar.gz
Vendor `six` consistently
Use vendored `six`, and also `six.moves.range` rather than `xrange`
Diffstat (limited to 'test/test_codec.py')
-rw-r--r--test/test_codec.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_codec.py b/test/test_codec.py
index d31fc86..e132c1d 100644
--- a/test/test_codec.py
+++ b/test/test_codec.py
@@ -4,7 +4,7 @@ import platform
import struct
import pytest
-from six.moves import xrange
+from kafka.vendor.six.moves import range
from kafka.codec import (
has_snappy, has_gzip, has_lz4,
@@ -18,7 +18,7 @@ from test.testutil import random_string
def test_gzip():
- for i in xrange(1000):
+ for i in range(1000):
b1 = random_string(100).encode('utf-8')
b2 = gzip_decode(gzip_encode(b1))
assert b1 == b2
@@ -26,7 +26,7 @@ def test_gzip():
@pytest.mark.skipif(not has_snappy(), reason="Snappy not available")
def test_snappy():
- for i in xrange(1000):
+ for i in range(1000):
b1 = random_string(100).encode('utf-8')
b2 = snappy_decode(snappy_encode(b1))
assert b1 == b2
@@ -86,7 +86,7 @@ def test_snappy_encode_xerial():
@pytest.mark.skipif(not has_lz4() or platform.python_implementation() == 'PyPy',
reason="python-lz4 crashes on old versions of pypy")
def test_lz4():
- for i in xrange(1000):
+ for i in range(1000):
b1 = random_string(100).encode('utf-8')
b2 = lz4_decode(lz4_encode(b1))
assert len(b1) == len(b2)
@@ -96,7 +96,7 @@ def test_lz4():
@pytest.mark.skipif(not has_lz4() or platform.python_implementation() == 'PyPy',
reason="python-lz4 crashes on old versions of pypy")
def test_lz4_old():
- for i in xrange(1000):
+ for i in range(1000):
b1 = random_string(100).encode('utf-8')
b2 = lz4_decode_old_kafka(lz4_encode_old_kafka(b1))
assert len(b1) == len(b2)
@@ -106,7 +106,7 @@ def test_lz4_old():
@pytest.mark.skipif(not has_lz4() or platform.python_implementation() == 'PyPy',
reason="python-lz4 crashes on old versions of pypy")
def test_lz4_incremental():
- for i in xrange(1000):
+ for i in range(1000):
# lz4 max single block size is 4MB
# make sure we test with multiple-blocks
b1 = random_string(100).encode('utf-8') * 50000