Skip to content

Commit efd20ff

Browse files
author
CM Lubinski
committed
Tests run in python3
1 parent aef205d commit efd20ff

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

django_elasticache/cluster_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_cluster_info(host, port):
4141
client.write(cmd)
4242
res = client.read_until('\n\r\nEND\r\n')
4343
client.close()
44-
ls = filter(None, re.compile(r'\r?\n').split(res))
44+
ls = list(filter(None, re.compile(r'\r?\n').split(res)))
4545
if len(ls) != 4:
4646
raise WrongProtocolData(cmd, res)
4747

tests/test_backend.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
from django.conf import global_settings, settings
2-
from mock import patch, Mock
32
from nose.tools import eq_, raises
3+
import sys
4+
if sys.version < '3':
5+
from mock import patch, Mock
6+
else:
7+
from unittest.mock import patch, Mock
8+
49

510
# Initialize django 1.7
611
settings.configure()

tests/test_protocol.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
from mock import patch, call, MagicMock
21
from django_elasticache.cluster_utils import (
32
get_cluster_info, WrongProtocolData)
43
from nose.tools import eq_, raises
4+
import sys
5+
if sys.version < '3':
6+
from mock import patch, call, MagicMock
7+
else:
8+
from unittest.mock import patch, call, MagicMock
9+
510

611
TEST_PROTOCOL_1 = [
712
'VERSION 1.4.14',

0 commit comments

Comments
 (0)