diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2020-02-01 22:38:37 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2020-02-01 22:38:37 -0800 |
commit | 1b050753d6ec6a6630c2cfd83c2cfbd741a3ced3 (patch) | |
tree | 8eeefe7db936c5e5ed843b6433fa95459c6b6188 /tests/test_connection_pool.py | |
parent | 5a1f3c448063b3e30d3283cd93ef50973abc3806 (diff) | |
download | redis-py-1b050753d6ec6a6630c2cfd83c2cfbd741a3ced3.tar.gz |
remove Redis and ConnectionPool __eq__ comparison
After further thought this was a bad idea. Just because two connection
pools share the same connection arguments does not make them equal.
It would seem quite odd if pool_a == pool_b yet pool_a.disconnect() doesn't
close all of pool_b's connections.
Ref #1240
Fixes #1277
Fixes #1275
Fixes #1267
Fixes #1273
Diffstat (limited to 'tests/test_connection_pool.py')
-rw-r--r-- | tests/test_connection_pool.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py index a862e4e..655e88d 100644 --- a/tests/test_connection_pool.py +++ b/tests/test_connection_pool.py @@ -88,47 +88,6 @@ class TestConnectionPool(object): 'path=/abc,db=1,client_name=test-client>>') assert repr(pool) == expected - def test_pool_equality(self): - connection_kwargs = {'host': 'localhost', 'port': 6379, 'db': 1} - pool1 = self.get_pool(connection_kwargs=connection_kwargs, - connection_class=redis.Connection) - pool2 = self.get_pool(connection_kwargs=connection_kwargs, - connection_class=redis.Connection) - assert pool1 == pool2 - - def test_pools_unequal_if_different_types(self): - connection_kwargs = {'host': 'localhost', 'port': 6379, 'db': 1} - pool = self.get_pool(connection_kwargs=connection_kwargs, - connection_class=redis.Connection) - assert pool != 0 - - def test_pools_unequal_if_different_hosts(self): - connection_kwargs1 = {'host': 'localhost', 'port': 6379, 'db': 1} - connection_kwargs2 = {'host': '127.0.0.1', 'port': 6379, 'db': 1} - pool1 = self.get_pool(connection_kwargs=connection_kwargs1, - connection_class=redis.Connection) - pool2 = self.get_pool(connection_kwargs=connection_kwargs2, - connection_class=redis.Connection) - assert pool1 != pool2 - - def test_pools_unequal_if_different_ports(self): - connection_kwargs1 = {'host': 'localhost', 'port': 6379, 'db': 1} - connection_kwargs2 = {'host': 'localhost', 'port': 6380, 'db': 1} - pool1 = self.get_pool(connection_kwargs=connection_kwargs1, - connection_class=redis.Connection) - pool2 = self.get_pool(connection_kwargs=connection_kwargs2, - connection_class=redis.Connection) - assert pool1 != pool2 - - def test_pools_unequal_if_different_dbs(self): - connection_kwargs1 = {'host': 'localhost', 'port': 6379, 'db': 1} - connection_kwargs2 = {'host': 'localhost', 'port': 6379, 'db': 2} - pool1 = self.get_pool(connection_kwargs=connection_kwargs1, - connection_class=redis.Connection) - pool2 = self.get_pool(connection_kwargs=connection_kwargs2, - connection_class=redis.Connection) - assert pool1 != pool2 - class TestBlockingConnectionPool(object): def get_pool(self, connection_kwargs=None, max_connections=10, timeout=20): |