From 8aba95f5062de633e5b8ca959957b279cac51b04 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 11 Oct 2023 07:18:14 +0100 Subject: [PATCH] SkipTest must have a reason --- spinn_utilities/data/utils_data_view.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/spinn_utilities/data/utils_data_view.py b/spinn_utilities/data/utils_data_view.py index 9ad14b5e..7a52be76 100644 --- a/spinn_utilities/data/utils_data_view.py +++ b/spinn_utilities/data/utils_data_view.py @@ -611,25 +611,18 @@ def _mock_has_run(cls): cls.__data._requires_data_generation = False cls.__data._requires_mapping = False - def raise_skiptest(self, reason=None, parent=None): + def raise_skiptest(self, reason, parent=None): """ Sets the status as shutdown amd raises a SkipTest - :param reason: Message for the exception is any - :type reason: Exception or None + :param Exception reason: Message for the exception is any :param parent: Exception which trggered the skip if any :type reason: Exception or None :raises: SkipTest very time called """ self.__data._data_status = DataStatus.SHUTDOWN self.__data._run_status = RunStatus.SHUTDOWN - if reason is None: - if parent is None: - raise SkipTest() - else: - raise SkipTest() from parent + if parent is None: + raise SkipTest(reason) else: - if parent is None: - raise SkipTest(reason) - else: - raise SkipTest(reason) from parent + raise SkipTest(reason) from parent