Skip to content

Commit

Permalink
Remove PY2 specific imports and tests
Browse files Browse the repository at this point in the history
* future was needed for some python 2 specific tests
* use mock from unittest.mock instead of the 3rd party mock library
  • Loading branch information
jogo committed May 27, 2021
1 parent ffa1c09 commit a89a551
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
18 changes: 0 additions & 18 deletions pymemcache/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -162,22 +160,6 @@ def test_set_success(self):
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''])

Expand Down
14 changes: 0 additions & 14 deletions pymemcache/test/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
future
mock
pytest
pytest-cov
gevent==20.9.0; "PyPy" not in platform_python_implementation
Expand Down

0 comments on commit a89a551

Please sign in to comment.