Skip to content

Commit

Permalink
Merge pull request #56 from sideshowdave7/python3-test-hang
Browse files Browse the repository at this point in the history
mock manager call
  • Loading branch information
sideshowdave7 committed Oct 15, 2017
2 parents caaac2a + 9ddd1de commit c170ffb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
3 changes: 2 additions & 1 deletion eventmq/tests/test_jobmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_send_ready(self, sndmsg_mock):

sndmsg_mock.assert_called_with(jm.outgoing, 'READY')

@mock.patch('multiprocessing.pool.Pool.close')
@mock.patch('multiprocessing.Manager')
@mock.patch('eventmq.jobmanager.JobManager.process_message')
@mock.patch('eventmq.jobmanager.Sender.recv_multipart')
@mock.patch('eventmq.jobmanager.Poller.poll')
Expand All @@ -56,6 +56,7 @@ def test__start_event_loop(self, maybe_send_hb_mock,
maybe_send_hb_mock.return_value = False
poll_mock.return_value = {jm.outgoing: jobmanager.POLLIN}
sender_mock.return_value = [1, 2, 3]
pool_close_mock.return_value = None

jm._start_event_loop()

Expand Down
12 changes: 0 additions & 12 deletions eventmq/tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,13 @@
# along with eventmq. If not, see <http://www.gnu.org/licenses/>.

import logging
from multiprocessing import Pool
import time

from nose import with_setup

from .. import worker

ADDR = 'inproc://pour_the_rice_in_the_thing'


def setup_func():
global pool
global out
pool = Pool()
out = pool.map(job, range(1))


@with_setup(setup_func)
def test_run_with_timeout():
payload = {
'path': 'eventmq.tests.test_worker',
Expand All @@ -44,7 +33,6 @@ def test_run_with_timeout():
assert msgid


@with_setup(setup_func)
def test_run_setup():
setup_callable = 'pre_hook'
setup_path = 'eventmq.tests.test_worker'
Expand Down

0 comments on commit c170ffb

Please sign in to comment.