Skip to content

Commit

Permalink
Merge pull request #47 from SpiNNakerManchester/raise_skiptest
Browse files Browse the repository at this point in the history
Raise skiptest
  • Loading branch information
rowleya authored Oct 2, 2023
2 parents 33099a9 + 4b531ac commit b8f6676
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spinnaker_testbase/root_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import sys
import time
import unittest
from unittest import SkipTest
from spinn_utilities.exceptions import NotSetupException
from spinnman.exceptions import SpinnmanException
from pacman.exceptions import PacmanPartitionException, PacmanValueError
Expand Down Expand Up @@ -49,7 +48,7 @@ def assert_not_spin_three():
"""
version = FecDataView.get_machine_version().number
if not version == 5:
raise SkipTest(
raise unittest.SkipTest(
f"This test will not run on a spinn-{version} board")

def error_file(self):
Expand Down Expand Up @@ -103,7 +102,8 @@ def runsafe(self, method, retry_delay=3.0, skip_exceptions=None):
except (JobDestroyedError, SpinnmanException) as ex:
for skip_exception in skip_exceptions:
if isinstance(ex, skip_exception):
raise SkipTest(f"{ex} Still not fixed!") from ex
FecDataView.raise_skiptest(
f"{ex} Still not fixed!", ex)
class_file = sys.modules[self.__module__].__file__
with open(self.error_file(), "a", encoding="utf-8") \
as error_file:
Expand All @@ -119,7 +119,8 @@ def runsafe(self, method, retry_delay=3.0, skip_exceptions=None):
self.assert_not_spin_three()
for skip_exception in skip_exceptions:
if isinstance(ex, skip_exception):
raise SkipTest(f"{ex} Still not fixed!") from ex
FecDataView.raise_skiptest(
f"{ex} Still not fixed!", ex)
raise ex
print("")
print("==========================================================")
Expand Down

0 comments on commit b8f6676

Please sign in to comment.