diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-11-02 06:30:07 -0700 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-11-03 03:21:49 -0700 |
commit | 5089cc275e6077a070017587001c22e490995d47 (patch) | |
tree | eb8e52047d04f36f1a9562fa47e0a853ffab79eb /tests/test_encoding.py | |
parent | 7a0e4c7f99463c79b456a48837b5687072e1485d (diff) | |
download | redis-py-5089cc275e6077a070017587001c22e490995d47.tar.gz |
Use unicode literals throughout project
Remove workaround for handling unicode with older Pythons.
Diffstat (limited to 'tests/test_encoding.py')
-rw-r--r-- | tests/test_encoding.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_encoding.py b/tests/test_encoding.py index 992e8ad..cff819f 100644 --- a/tests/test_encoding.py +++ b/tests/test_encoding.py @@ -1,7 +1,8 @@ +from __future__ import unicode_literals import pytest import redis -from redis._compat import unichr, u, unicode +from redis._compat import unichr, unicode from .conftest import _get_client @@ -11,20 +12,20 @@ class TestEncoding(object): return _get_client(redis.Redis, request=request, decode_responses=True) def test_simple_encoding(self, r): - unicode_string = unichr(3456) + u('abcd') + unichr(3421) + unicode_string = unichr(3456) + 'abcd' + unichr(3421) r['unicode-string'] = unicode_string cached_val = r['unicode-string'] assert isinstance(cached_val, unicode) assert unicode_string == cached_val def test_list_encoding(self, r): - unicode_string = unichr(3456) + u('abcd') + unichr(3421) + unicode_string = unichr(3456) + 'abcd' + unichr(3421) result = [unicode_string, unicode_string, unicode_string] r.rpush('a', *result) assert r.lrange('a', 0, -1) == result def test_object_value(self, r): - unicode_string = unichr(3456) + u('abcd') + unichr(3421) + unicode_string = unichr(3456) + 'abcd' + unichr(3421) r['unicode-string'] = Exception(unicode_string) cached_val = r['unicode-string'] assert isinstance(cached_val, unicode) |