Skip to content

Commit

Permalink
chore: Refactor code quality issues (#1320)
Browse files Browse the repository at this point in the history
* chore: refactor code quality issues

* remove .deepsource.toml config file
  • Loading branch information
akshgpt7 authored Apr 28, 2021
1 parent 9dbe842 commit 3b6cd13
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 8 deletions.
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

0 comments on commit 3b6cd13

Please sign in to comment.