aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_taskipy.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_taskipy.py')
-rw-r--r--tests/test_taskipy.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_taskipy.py b/tests/test_taskipy.py
index 5733006..37b322d 100644
--- a/tests/test_taskipy.py
+++ b/tests/test_taskipy.py
@@ -247,6 +247,20 @@ class InterruptingTaskTestCase(TaskipyTestCase):
self.assertEqual(exit_code, 130)
+ def test_sigterm_should_be_sent_to_subprocess(self):
+ cwd = self.create_test_dir_from_fixture('project_with_tasks_that_handle_sigterm')
+ process = self.start_taskipy_process('run_loop_with_sigterm_handling', cwd=cwd)
+
+ time.sleep(.2)
+
+ process.send_signal(signal.SIGTERM)
+
+ exit_code = process.wait()
+ stdout, _ = process.communicate()
+
+ self.assertEqual(exit_code, 123)
+ self.assertSubstr('sigterm', str(stdout))
+
class CustomRunnerTestCase(TaskipyTestCase):
def test_running_command_with_custom_runner(self):