Skip to content

Commit

Permalink
merged in master
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 2, 2023
2 parents e733714 + 812449c commit 2d24551
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

from spinnaker_testbase import BaseTestCase
from spynnaker_integration_tests.scripts import SynfireRunner
from spynnaker.pyNN.data import SpynnakerDataView
import spynnaker.spike_checker as spike_checker
from spinnman.exceptions import SpinnmanTimeoutException
from unittest import SkipTest

n_neurons = 10 # number of neurons in each population
runtime = 50
Expand All @@ -43,7 +43,7 @@ def allow(self):
# no check of gsyn as the system overloads
# System intentional overload so may error
except SpinnmanTimeoutException as ex:
raise SkipTest() from ex
SpynnakerDataView.raise_skiptest(parent=ex)

def test_allow(self):
self.runsafe(self.allow)
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest
from spinn_utilities.exceptions import SimulatorShutdownException
import pyNN.spiNNaker as p
from time import sleep
import traceback
from spynnaker.pyNN.data import SpynnakerDataView

from spynnaker.pyNN.external_devices import SpynnakerLiveSpikesConnection

Expand Down Expand Up @@ -82,7 +82,7 @@ def test_live_sync():
p.external_devices.run_sync(100, 20)
except Exception:
if sim_finished:
raise unittest.SkipTest("Stopped to0 soon")
SpynnakerDataView.raise_skiptest("Stopped too soon")

sim_finished = True
p.end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

import unittest
from unittest import SkipTest
from spynnaker.pyNN.exceptions import ConfigurationException
import pyNN.spiNNaker as p
from spynnaker.pyNN.data import SpynnakerDataView
import spynnaker.pyNN.external_devices as e
from spinnaker_testbase import BaseTestCase

Expand All @@ -35,8 +35,8 @@ def multi_board_spike_output(self):
machine = p.get_machine()
except ConfigurationException as oops:
if "Failure to detect machine of " in str(oops):
raise SkipTest(
"You Need at least 3 boards to run this test") from oops
SpynnakerDataView.raise_skiptest(
"You Need at least 3 boards to run this test", oops)

labels = list()
pops = list()
Expand Down
7 changes: 3 additions & 4 deletions spynnaker_integration_tests/test_many_boards/many_boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import time
from unittest import SkipTest
from spinn_utilities.config_holder import get_config_bool
from spinn_front_end_common.interface.provenance import GlobalProvenance
from spynnaker.pyNN.data import SpynnakerDataView
Expand Down Expand Up @@ -44,9 +43,9 @@ def setup(self):
machine = sim.get_machine()
except ConfigurationException as oops:
if "Failure to detect machine " in str(oops):
raise SkipTest(
"You Need at least {} boards to run this test".format(
self.n_boards)) from oops
SpynnakerDataView.raise_skiptest(
f"You Need at least {self.n_boards} boards for this test",
oops)
raise oops

input_spikes = list(range(0, self.simtime - 100, 10))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import math
from unittest import SkipTest
from spynnaker.pyNN.exceptions import ConfigurationException
import pyNN.spiNNaker as sim
from spynnaker.pyNN.data import SpynnakerDataView
from spynnaker.pyNN.extra_algorithms.splitter_components import (
SplitterAbstractPopulationVertexFixed)

Expand All @@ -28,8 +28,8 @@ def find_good_chip(machine, n_target):
if chip.n_user_processors > n_target:
print(chip.n_user_processors)
return (x, y)
raise SkipTest("No Chip found with You Need at least {} user processors"
.format(n_target))
SpynnakerDataView.raise_skiptest(
f"No Chip found with at least {n_target} user processors")


def do_bitfield_run():
Expand All @@ -43,9 +43,8 @@ def do_bitfield_run():
machine = sim.get_machine()
except ConfigurationException as oops:
if "Failure to detect machine " in str(oops):
raise SkipTest(
"You Need at least {} boards to run this test".format(
n_boards)) from oops
SpynnakerDataView.raise_skiptest(
f"You Need at least {n_boards} boards to run this test", oops)
raise oops
target_x, target_y = find_good_chip(machine, n_target)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import math
from unittest import SkipTest
from spinn_front_end_common.interface.provenance import GlobalProvenance
from spynnaker.pyNN.exceptions import ConfigurationException
import pyNN.spiNNaker as sim
from spynnaker.pyNN import SpynnakerDataView
from spynnaker.pyNN.extra_algorithms.splitter_components import (
SplitterAbstractPopulationVertexFixed)

Expand All @@ -29,8 +29,8 @@ def find_good_chip(machine, n_target):
if chip.n_user_processors > n_target:
print(chip.n_user_processors, "processors on", x, y)
return (x, y)
raise SkipTest("No Chip found with You Need at least {} user processors"
.format(n_target))
SpynnakerDataView.raise_skiptest(
f"No Chip found with at least {n_target} user processors")


def do_run():
Expand All @@ -44,9 +44,8 @@ def do_run():
machine = sim.get_machine()
except ConfigurationException as oops:
if "Failure to detect machine " in str(oops):
raise SkipTest(
"You Need at least {} boards to run this test".format(
n_boards)) from oops
SpynnakerDataView.raise_skiptest(
f"You Need at least {n_boards} boards to run this test", oops)
raise oops
target_x, target_y = find_good_chip(machine, n_target)

Expand Down

0 comments on commit 2d24551

Please sign in to comment.