From 00f3dd5edbb208c17e096ae858ac9f181c1c144a Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Thu, 27 May 2021 09:53:42 -0700 Subject: Remove PY2 specific imports and tests * future was needed for some python 2 specific tests * use mock from unittest.mock instead of the 3rd party mock library --- pymemcache/test/test_client.py | 18 ------------------ pymemcache/test/test_integration.py | 14 -------------- 2 files changed, 32 deletions(-) (limited to 'pymemcache') diff --git a/pymemcache/test/test_client.py b/pymemcache/test/test_client.py index f0aac44..1bf8d57 100644 --- a/pymemcache/test/test_client.py +++ b/pymemcache/test/test_client.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from builtins import bytes as newbytes - import collections import errno import functools @@ -225,22 +223,6 @@ class ClientTestMixin: result = client.set(b'key', b'value', noreply=False, flags=0x00000030) assert result is True - def test_set_future(self): - client = self.make_client([b'STORED\r\n']) - result = client.set(newbytes(b'key'), newbytes(b'value'), noreply=False) - assert result is True - - # unit test for encoding passed in __init__() - client = self.make_client([b'STORED\r\n'], encoding='utf-8') - result = client.set(newbytes(b'key'), newbytes(b'value'), noreply=False) - assert result is True - - # unit test for set operation with parameter flags - client = self.make_client([b'STORED\r\n'], encoding='utf-8') - result = client.set(newbytes(b'key'), newbytes(b'value'), noreply=False, - flags=0x00000030) - assert result is True - def test_set_unicode_key(self): client = self.make_client([b'']) diff --git a/pymemcache/test/test_integration.py b/pymemcache/test/test_integration.py index 8dde849..8ca3ba7 100644 --- a/pymemcache/test/test_integration.py +++ b/pymemcache/test/test_integration.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from builtins import bytes as newbytes - from collections import defaultdict import json import pytest @@ -60,18 +58,6 @@ def test_get_set(client_class, host, port, socket_module): get_set_helper(client, key, value, key2, value2) -@pytest.mark.integration() -def test_get_set_newbytes(client_class, host, port, socket_module): - client = client_class((host, port), socket_module=socket_module) - client.flush_all() - - key = newbytes(b'key3') - value = b'value3' - key2 = newbytes(b'key4') - value2 = b'value4' - get_set_helper(client, key, value, key2, value2) - - @pytest.mark.integration() def test_get_set_unicode_key(client_class, host, port, socket_module): client = client_class((host, port), socket_module=socket_module, -- cgit v1.2.1