Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Refactor code quality issues #1320

Merged
merged 2 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions kombu/transport/qpid.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,7 @@ def _has_queue(self, queue, **kwargs):
: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,
Expand Down
2 changes: 1 addition & 1 deletion kombu/utils/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion t/unit/asynchronous/test_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def test_supports_Timer_interface(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion t/unit/test_clocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_order(self):
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')
Expand Down
1 change: 0 additions & 1 deletion t/unit/transport/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,6 @@ def test_get_client(self):
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):
Expand Down