Skip to content

Commit

Permalink
maint: remove unused warning wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
asoplata committed Feb 10, 2025
1 parent bc778ef commit 26e4b7a
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions hnn_core/tests/test_parallel_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,24 +241,18 @@ def test_run_mpibackend_oversubscribed(self, run_hnn_core_fixture,
simulate_dipole(net, tstop=40)

# Check that the simulation fails if oversubscribe is forced off
with pytest.warns(UserWarning) as record:
with MPIBackend(
n_procs=oversubscribed_procs,
use_hwthreading_if_found=use_hwthreading_if_found,
override_oversubscribe_option=False,
) as backend:
assert "--oversubscribe" not in ' '.join(backend.mpi_cmd)
if detected_hwthreading:
assert "--use-hwthread-cpus" in ' '.join(backend.mpi_cmd)
with pytest.raises(
RuntimeError,
match="MPI simulation failed. Return code: 1"):
simulate_dipole(net, tstop=40)

expected_string = ('Received BrokenPipeError exception. '
'Child process failed unexpectedly')
assert len(record) == 2
assert expected_string in record[0].message.args[0]
with MPIBackend(
n_procs=oversubscribed_procs,
use_hwthreading_if_found=use_hwthreading_if_found,
override_oversubscribe_option=False,
) as backend:
assert "--oversubscribe" not in ' '.join(backend.mpi_cmd)
if detected_hwthreading:
assert "--use-hwthread-cpus" in ' '.join(backend.mpi_cmd)
with pytest.raises(
RuntimeError,
match="MPI simulation failed. Return code: 1"):
simulate_dipole(net, tstop=40)

# Check that simulation succeeds if oversubscription is activated but
# unnecessary
Expand Down

0 comments on commit 26e4b7a

Please sign in to comment.