From e2623731d7c3083006f08edff8256f44dfa0a1ce Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Tue, 12 Aug 2014 17:28:11 -0300 Subject: [PATCH] avocado.core.exceptions: Introducing TestInterruptError Add a special exception for when tests are interrupted by Ctrl + C, and the required mapping in status. Signed-off-by: Lucas Meneghel Rodrigues --- avocado/core/exceptions.py | 8 ++++++++ avocado/core/status.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/avocado/core/exceptions.py b/avocado/core/exceptions.py index cb1f303c..74ad5e10 100644 --- a/avocado/core/exceptions.py +++ b/avocado/core/exceptions.py @@ -83,6 +83,14 @@ class TestTimeoutError(TestBaseException): status = "ERROR" +class TestInterruptedError(TestBaseException): + + """ + Indicates that the test was interrupted by the user (Ctrl+C) + """ + status = "INTERRUPTED" + + class TestAbortError(TestBaseException): """ diff --git a/avocado/core/status.py b/avocado/core/status.py index 44f1993a..d21fe267 100644 --- a/avocado/core/status.py +++ b/avocado/core/status.py @@ -25,7 +25,8 @@ mapping = {"TEST_NA": True, "START": True, "ALERT": False, "RUNNING": False, - "NOSTATUS": False} + "NOSTATUS": False, + "INTERRUPTED": False} feedback = { # Test did not advertise current status, but process running the test is -- GitLab