diff options
author | Aksh Gupta <akshgpt7@gmail.com> | 2021-04-28 21:10:37 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 18:40:37 +0300 |
commit | 3b6cd13d3b6da22f86a23b93b66c49133776cc75 (patch) | |
tree | 1c7ff3d922bf2d47872800933f6cff9afabb5435 | |
parent | 9dbe842195bb38a43a56546747c3f90253e64681 (diff) | |
download | kombu-3b6cd13d3b6da22f86a23b93b66c49133776cc75.tar.gz |
chore: Refactor code quality issues (#1320)
* chore: refactor code quality issues
* remove .deepsource.toml config file
-rw-r--r-- | kombu/transport/qpid.py | 5 | ||||
-rw-r--r-- | kombu/utils/compat.py | 2 | ||||
-rw-r--r-- | t/unit/asynchronous/test_timer.py | 1 | ||||
-rw-r--r-- | t/unit/test_clocks.py | 2 | ||||
-rw-r--r-- | t/unit/transport/test_redis.py | 1 |
5 files changed, 3 insertions, 8 deletions
diff --git a/kombu/transport/qpid.py b/kombu/transport/qpid.py index cacd3489..66ee69a5 100644 --- a/kombu/transport/qpid.py +++ b/kombu/transport/qpid.py @@ -584,10 +584,7 @@ class Channel(base.StdChannel): :rtype: bool """ - if self._broker.getQueue(queue): - return True - else: - return False + return bool(self._broker.getQueue(queue)) def queue_declare(self, queue, passive=False, durable=False, exclusive=False, auto_delete=True, nowait=False, diff --git a/kombu/utils/compat.py b/kombu/utils/compat.py index 8adc49b8..d758cd08 100644 --- a/kombu/utils/compat.py +++ b/kombu/utils/compat.py @@ -130,7 +130,7 @@ def nested(*managers): # pragma: no cover while exits: exit = exits.pop() try: - if exit(*exc): + if sys.exit(*exc): exc = (None, None, None) except: exc = sys.exc_info() diff --git a/t/unit/asynchronous/test_timer.py b/t/unit/asynchronous/test_timer.py index a521d368..07d8a34d 100644 --- a/t/unit/asynchronous/test_timer.py +++ b/t/unit/asynchronous/test_timer.py @@ -73,7 +73,6 @@ class test_Timer: assert x.schedule is x def test_handle_error(self): - from datetime import datetime on_error = Mock(name='on_error') s = Timer(on_error=on_error) diff --git a/t/unit/test_clocks.py b/t/unit/test_clocks.py index c8d52bec..00dcb729 100644 --- a/t/unit/test_clocks.py +++ b/t/unit/test_clocks.py @@ -79,7 +79,7 @@ class test_timetuple: assert a <= b assert b >= a - assert (timetuple(134, time(), 'A', 'obj').__lt__(tuple()) is + assert (timetuple(134, time(), 'A', 'obj').__lt__(()) is NotImplemented) assert timetuple(134, t2, 'A', 'obj') > timetuple(133, t1, 'A', 'obj') assert timetuple(134, t1, 'B', 'obj') > timetuple(134, t1, 'A', 'obj') diff --git a/t/unit/transport/test_redis.py b/t/unit/transport/test_redis.py index faa01f6d..bed48b0d 100644 --- a/t/unit/transport/test_redis.py +++ b/t/unit/transport/test_redis.py @@ -1043,7 +1043,6 @@ class test_Redis: assert conn.transport.channel_errors def test_check_at_least_we_try_to_connect_and_fail(self): - import redis connection = Connection('redis://localhost:65534/') with pytest.raises(redis.exceptions.ConnectionError): |