diff options
| author | RobinFrcd <29704178+RobinFrcd@users.noreply.github.com> | 2020-08-08 00:52:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-08 01:52:47 +0300 |
| commit | 3a0362a6028b949016cd2a67bbeeab9b8d8bf50c (patch) | |
| tree | 28be91f83e270b4ff461c39cef3047e68cd778bc /tests/test_taskipy.py | |
| parent | docs: add eugenetriguba as a contributor (#17) (diff) | |
| download | taskipy2-3a0362a6028b949016cd2a67bbeeab9b8d8bf50c.zip | |
Propagate SIGTERM to child processes (#19)
SIGTERM sent to taskipy are handed over to task subprocess
Diffstat (limited to 'tests/test_taskipy.py')
| -rw-r--r-- | tests/test_taskipy.py | 14 |
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): |