Skip to content

Commit

Permalink
correct test to prevent fail on DeprecationWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
cjayb authored and ntolley committed Jun 25, 2021
1 parent 3cc5e8a commit 92f7354
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hnn_core/tests/test_parallel_backends.py
Expand Up @@ -198,13 +198,14 @@ def test_mpi_failure(run_hnn_core_fixture):
with pytest.warns(UserWarning) as record:
with io.StringIO() as buf, redirect_stdout(buf):
with pytest.raises(RuntimeError, match="MPI simulation failed"):
run_hnn_core_fixture(backend='mpi', reduced=True)
run_hnn_core_fixture(backend='mpi', reduced=True,
postproc=False)
stdout = buf.getvalue()

assert "MPI processes are unable to reach each other" in stdout

expected_string = "Child process failed unexpectedly"
# last warning is the expected one, earlier ones DeprecationWarnings
assert record[-1].message.args[-1] == expected_string
assert len(record) == 1
assert record[0].message.args[0] == expected_string

del environ["OMPI_MCA_btl"]

0 comments on commit 92f7354

Please sign in to comment.