Skip to content

Commit

Permalink
send signal with Popen.send_signal
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Nov 1, 2016
1 parent b385270 commit 8791609
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/integration/test_worker.py
@@ -1,4 +1,3 @@
import os
import json
import signal
import logging
Expand Down Expand Up @@ -89,7 +88,7 @@ def test_worker_sigquit(self):
tasks.loop_forever()
with run_worker() as worker:
worker.expect('looping forever')
os.kill(worker.pid, signal.SIGUSR2)
worker.send_signal(signal.SIGUSR2)
worker.expect('Dropping current task')
assert len_queue("kuyruk") == 0, worker.get_output()

Expand Down Expand Up @@ -175,7 +174,7 @@ def test_sigint(self):
tasks.just_sleep(10)
with run_worker(terminate=False) as worker:
worker.expect('Processing task')
os.kill(worker.pid, signal.SIGINT)
worker.send_signal(signal.SIGINT)
worker.expect('Task is successful')
worker.expect_exit(0)
assert len_queue("kuyruk") == 0, worker.get_output()
Expand All @@ -184,5 +183,5 @@ def test_sigusr1(self):
"""Print stacktrace on SIGUSR1"""
with run_worker() as worker:
worker.expect('Consumer started')
os.kill(worker.pid, signal.SIGUSR1)
worker.send_signal(signal.SIGUSR1)
worker.expect('traceback.format_stack')

0 comments on commit 8791609

Please sign in to comment.