diff options
author | John Anderson <sontek@gmail.com> | 2015-06-20 00:09:53 -0700 |
---|---|---|
committer | John Anderson <sontek@gmail.com> | 2015-06-20 00:09:53 -0700 |
commit | e905884ede997ef14e53e64f507123513c6d9856 (patch) | |
tree | 8fbbac9646b22b4ad671e07c6b585b43a315c8bd /pymemcache | |
parent | cd4b7b6e3a8713ad8d2a9eb63bc1bdc07dd93a18 (diff) | |
download | pymemcache-e905884ede997ef14e53e64f507123513c6d9856.tar.gz |
flake8 the tests
Diffstat (limited to 'pymemcache')
-rw-r--r-- | pymemcache/test/conftest.py | 1 | ||||
-rw-r--r-- | pymemcache/test/integration.py | 3 | ||||
-rw-r--r-- | pymemcache/test/test_client.py | 15 | ||||
-rw-r--r-- | pymemcache/test/test_integration.py | 5 | ||||
-rw-r--r-- | pymemcache/test/test_utils.py | 5 |
5 files changed, 16 insertions, 13 deletions
diff --git a/pymemcache/test/conftest.py b/pymemcache/test/conftest.py index da4c50c..8792cc3 100644 --- a/pymemcache/test/conftest.py +++ b/pymemcache/test/conftest.py @@ -1,6 +1,7 @@ import pytest import socket + def pytest_addoption(parser): parser.addoption('--server', action='store', default='localhost', diff --git a/pymemcache/test/integration.py b/pymemcache/test/integration.py index 37a60ea..87acb95 100644 --- a/pymemcache/test/integration.py +++ b/pymemcache/test/integration.py @@ -18,8 +18,7 @@ import socket import six -from pymemcache.client import (Client, MemcacheClientError, - MemcacheUnknownCommandError) +from pymemcache.client import (Client, MemcacheClientError) from pymemcache.client import MemcacheIllegalInputError from nose import tools diff --git a/pymemcache/test/test_client.py b/pymemcache/test/test_client.py index f4957f1..1efb030 100644 --- a/pymemcache/test/test_client.py +++ b/pymemcache/test/test_client.py @@ -103,7 +103,7 @@ class ClientTestMixin(object): def test_set_many_success(self): client = self.make_client([b'STORED\r\n']) - result = client.set_many({b'key' : b'value'}, noreply=False) + result = client.set_many({b'key': b'value'}, noreply=False) assert result is True def test_add_stored(self): @@ -268,7 +268,6 @@ class TestClient(ClientTestMixin, unittest.TestCase): result = client.get_many([b'key1', b'key2']) assert result == {b'key1': b'value1', b'key2': b'value2'} - client = self.make_client([b'VALUE key1 0 6\r\n', b'value1\r\n', b'VALUE key2 0 6\r\n', @@ -426,7 +425,7 @@ class TestClient(ClientTestMixin, unittest.TestCase): with pytest.raises(Exception): _set() - assert client.sock == None + assert client.sock is None def test_set_client_error(self): client = self.make_client([b'CLIENT_ERROR some message\r\n']) @@ -535,7 +534,7 @@ class TestClient(ClientTestMixin, unittest.TestCase): client = self.make_client([b'END\r\n']) def _get(): - _ = client[b'key'] + client[b'key'] with pytest.raises(KeyError): _get() @@ -573,8 +572,9 @@ class TestClientSocketConnect(unittest.TestCase): timeout = 2 connect_timeout = 3 - client = Client(server, connect_timeout=connect_timeout, timeout=timeout, - socket_module=MockSocketModule()) + client = Client( + server, connect_timeout=connect_timeout, timeout=timeout, + socket_module=MockSocketModule()) client._connect() assert client.sock.timeouts == [connect_timeout, timeout] @@ -582,7 +582,8 @@ class TestClientSocketConnect(unittest.TestCase): client._connect() assert client.sock.socket_options == [] - client = Client(server, socket_module=MockSocketModule(), no_delay=True) + client = Client( + server, socket_module=MockSocketModule(), no_delay=True) client._connect() assert client.sock.socket_options == [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)] diff --git a/pymemcache/test/test_integration.py b/pymemcache/test/test_integration.py index 991e74d..52576fe 100644 --- a/pymemcache/test/test_integration.py +++ b/pymemcache/test/test_integration.py @@ -12,14 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import argparse import json -import socket import pytest import six -from pymemcache.client import (Client, MemcacheClientError, - MemcacheUnknownCommandError) +from pymemcache.client import (Client, MemcacheClientError) from pymemcache.client import MemcacheIllegalInputError diff --git a/pymemcache/test/test_utils.py b/pymemcache/test/test_utils.py index d283aeb..adc7584 100644 --- a/pymemcache/test/test_utils.py +++ b/pymemcache/test/test_utils.py @@ -4,6 +4,7 @@ import pytest from pymemcache.test.utils import MockMemcacheClient +@pytest.mark.unit() def test_get_set(): client = MockMemcacheClient() assert client.get(b"hello") is None @@ -12,6 +13,7 @@ def test_get_set(): assert client.get(b"hello") == 12 +@pytest.mark.unit() def test_get_many_set_many(): client = MockMemcacheClient() client.set(b"h", 1) @@ -26,6 +28,7 @@ def test_get_many_set_many(): assert client.get_many([b"h", b"e", b"l", b"o"]) == d +@pytest.mark.unit() def test_add(): client = MockMemcacheClient() @@ -36,6 +39,7 @@ def test_add(): assert client.get(b"k") == 2 +@pytest.mark.unit() def test_delete(): client = MockMemcacheClient() @@ -46,6 +50,7 @@ def test_delete(): assert client.get(b"k") is None +@pytest.mark.unit() def test_incr_decr(): client = MockMemcacheClient() |