summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-11-12 09:51:49 -0800
committerAndy McCurdy <andy@andymccurdy.com>2019-11-12 09:51:49 -0800
commit656b551eb247c491976646092a71320407c0fa03 (patch)
tree88e3284a3132967369fbd418c1584731ed965e56
parent5f17b0e48a476a3ec748a774aaeede9fa6bcacab (diff)
downloadredis-py-656b551eb247c491976646092a71320407c0fa03.tar.gz
Compare numbers using '==' instead of 'is' (#1245)
While numbers are frequently singletons as an optimization, it is not guaranteed by the language specification. Fixes flake8 error: F632 use ==/!= to compare str, bytes, and int literals
-rw-r--r--tests/test_multiprocessing.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_multiprocessing.py b/tests/test_multiprocessing.py
index 17bdcc2..018914c 100644
--- a/tests/test_multiprocessing.py
+++ b/tests/test_multiprocessing.py
@@ -47,7 +47,7 @@ class TestMultiprocessing(object):
proc = multiprocessing.Process(target=target, args=(conn,))
proc.start()
proc.join(3)
- assert proc.exitcode is 0
+ assert proc.exitcode == 0
# The connection was created in the parent but disconnected in the
# child. The child called socket.close() but did not call
@@ -81,7 +81,7 @@ class TestMultiprocessing(object):
ev.set()
proc.join(3)
- assert proc.exitcode is 0
+ assert proc.exitcode == 0
@pytest.mark.parametrize('max_connections', [1, 2, None])
def test_pool(self, max_connections):
@@ -109,7 +109,7 @@ class TestMultiprocessing(object):
proc = multiprocessing.Process(target=target, args=(pool,))
proc.start()
proc.join(3)
- assert proc.exitcode is 0
+ assert proc.exitcode == 0
# Check that connection is still alive after fork process has exited
# and disconnected the connections in its pool
@@ -148,7 +148,7 @@ class TestMultiprocessing(object):
pool.disconnect()
ev.set()
proc.join(3)
- assert proc.exitcode is 0
+ assert proc.exitcode == 0
def test_redis_client(self, r):
"A redis client created in a parent can also be used in a child"
@@ -161,6 +161,6 @@ class TestMultiprocessing(object):
proc = multiprocessing.Process(target=target, args=(r,))
proc.start()
proc.join(3)
- assert proc.exitcode is 0
+ assert proc.exitcode == 0
assert r.ping() is True