Commit e4f038da authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][worker] Code cleanup

parent 6c87e892
...@@ -37,19 +37,12 @@ ...@@ -37,19 +37,12 @@
# Tests for experiment execution # Tests for experiment execution
import os import os
import logging import logging
logger = logging.getLogger(__name__)
import unittest import unittest
import simplejson import simplejson
import multiprocessing import multiprocessing
import queue
try:
import Queue
except ImportError:
import queue as Queue
from time import time from time import time
from time import sleep from time import sleep
...@@ -60,6 +53,9 @@ from ..utils import find_free_port ...@@ -60,6 +53,9 @@ from ..utils import find_free_port
from . import prefix, tmp_prefix from . import prefix, tmp_prefix
logger = logging.getLogger(__name__)
# ---------------------------------------------------------- # ----------------------------------------------------------
...@@ -165,7 +161,7 @@ class ControllerProcess(multiprocessing.Process): ...@@ -165,7 +161,7 @@ class ControllerProcess(multiprocessing.Process):
command = self.queue.get_nowait() command = self.queue.get_nowait()
if command == "STOP": if command == "STOP":
break break
except Queue.Empty: except queue.Empty:
pass pass
self.controller.destroy() self.controller.destroy()
...@@ -390,7 +386,7 @@ class TestOneWorker(TestWorkerBase): ...@@ -390,7 +386,7 @@ class TestOneWorker(TestWorkerBase):
return message return message
def _check_done(self, message, expected_worker, expected_job_id): def _check_done(self, message, expected_worker, expected_job_id):
self.assertTrue(message is not None) self.assertIsNotNone(message)
(worker, status, job_id, data) = message (worker, status, job_id, data) = message
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment