aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fixtures
diff options
context:
space:
mode:
authorRoy Sommer <illBeRoy@users.noreply.github.com>2020-02-01 17:11:46 +0200
committerGitHub <noreply@github.com>2020-02-01 17:11:46 +0200
commitf6248d4521a4a23d58137058cd400af4fef33af7 (patch)
treef667db8e7db80755e349bc456f5e65d1f4edb620 /tests/fixtures
parentrenamed hooks dir (diff)
downloadtaskipy2-f6248d4521a4a23d58137058cd400af4fef33af7.zip
Ignore SIGINT While Running Tasks (#8)
fix: sigint is now ignored by taskipy process, reflects output of task instead
Diffstat (limited to 'tests/fixtures')
-rw-r--r--tests/fixtures/project_with_tasks_that_handle_interrupts/loop_with_sigint_handler.py11
-rw-r--r--tests/fixtures/project_with_tasks_that_handle_interrupts/loop_without_sigint_handler.py12
-rw-r--r--tests/fixtures/project_with_tasks_that_handle_interrupts/pyproject.toml7
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/fixtures/project_with_tasks_that_handle_interrupts/loop_with_sigint_handler.py b/tests/fixtures/project_with_tasks_that_handle_interrupts/loop_with_sigint_handler.py
new file mode 100644
index 0000000..80f7b23
--- /dev/null
+++ b/tests/fixtures/project_with_tasks_that_handle_interrupts/loop_with_sigint_handler.py
@@ -0,0 +1,11 @@
+import time
+
+def main():
+ try:
+ while True:
+ time.sleep(.1)
+ except KeyboardInterrupt:
+ print('failing gracefully...')
+
+if __name__ == '__main__':
+ main()
diff --git a/tests/fixtures/project_with_tasks_that_handle_interrupts/loop_without_sigint_handler.py b/tests/fixtures/project_with_tasks_that_handle_interrupts/loop_without_sigint_handler.py
new file mode 100644
index 0000000..87189f9
--- /dev/null
+++ b/tests/fixtures/project_with_tasks_that_handle_interrupts/loop_without_sigint_handler.py
@@ -0,0 +1,12 @@
+import time
+import sys
+
+def main():
+ try:
+ while True:
+ time.sleep(.1)
+ except:
+ sys.exit(130)
+
+if __name__ == '__main__':
+ main()
diff --git a/tests/fixtures/project_with_tasks_that_handle_interrupts/pyproject.toml b/tests/fixtures/project_with_tasks_that_handle_interrupts/pyproject.toml
new file mode 100644
index 0000000..f406cbb
--- /dev/null
+++ b/tests/fixtures/project_with_tasks_that_handle_interrupts/pyproject.toml
@@ -0,0 +1,7 @@
+[tool.poetry]
+name = "taskipy"
+description = "tasks runner for python projects"
+
+[tool.taskipy.tasks]
+run_loop_with_interrupt_handling = "python3 loop_with_sigint_handler.py"
+run_loop_without_interrupt_handling = "python3 loop_without_sigint_handler.py"