uses empty() instead of qsize() == 0

This commit is contained in:
Ilan
2015-08-04 18:30:07 +02:00
parent b85738675a
commit f470fbf975
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ class Sentinel(object):
if not self.start_event.is_set() and not self.stop_event.is_set():
return Conf.STARTING
elif self.start_event.is_set() and not self.stop_event.is_set():
if Conf.QSIZE and self.result_queue.qsize() == 0 and self.task_queue.qsize() == 0:
if self.result_queue.empty() and self.task_queue.empty():
return Conf.IDLE
return Conf.WORKING
elif self.stop_event.is_set() and self.start_event.is_set():
+1 -2
View File
@@ -55,8 +55,7 @@ def test_cluster_initial(r):
assert c.is_starting is False
sleep(0.5)
stat = c.stat
if Conf.QSIZE:
assert stat.status == Conf.IDLE
assert stat.status == Conf.IDLE
assert c.stop() is True
assert c.sentinel.is_alive() is False
assert c.has_stopped