diff --git a/python/tests/test_dump_load.py b/python/tests/test_dump_load.py index cf429fc70..d21f371a4 100644 --- a/python/tests/test_dump_load.py +++ b/python/tests/test_dump_load.py @@ -119,7 +119,10 @@ def get_field_point(sim): def test_load_dump_structure_2d(self): self._load_dump_structure_2d() - @unittest.skipIf(not mp.with_mpi(), "MPI specific test") + @unittest.skipIf( + not mp.with_mpi() or mp.count_processors() < 2, + "MPI specific test (requires mpirun with more than 1 process)", + ) def test_load_dump_structure_sharded_2d(self): self._load_dump_structure_2d(single_parallel_file=False) @@ -226,7 +229,10 @@ def get_field_point(sim): def test_load_dump_structure_3d(self): self._load_dump_structure_3d() - @unittest.skipIf(not mp.with_mpi(), "MPI specific test") + @unittest.skipIf( + not mp.with_mpi() or mp.count_processors() < 2, + "MPI specific test (requires mpirun with more than 1 process)", + ) def test_load_dump_structure_sharded_3d(self): self._load_dump_structure_3d(single_parallel_file=False) @@ -348,7 +354,10 @@ def get_field_point(sim): def test_load_dump_fields_2d(self): self._load_dump_fields_2d() - @unittest.skipIf(not mp.with_mpi(), "MPI specific test") + @unittest.skipIf( + not mp.with_mpi() or mp.count_processors() < 2, + "MPI specific test (requires mpirun with more than 1 process)", + ) def test_load_dump_fields_sharded_2d(self): self._load_dump_fields_2d(single_parallel_file=False) @@ -468,7 +477,10 @@ def get_field_point(sim): def test_load_dump_fields_3d(self): self._load_dump_fields_3d() - @unittest.skipIf(not mp.with_mpi(), "MPI specific test") + @unittest.skipIf( + not mp.with_mpi() or mp.count_processors() < 2, + "MPI specific test (requires mpirun with more than 1 process)", + ) def test_load_dump_fields_sharded_3d(self): self._load_dump_fields_3d(single_parallel_file=False) diff --git a/python/tests/test_simulation.py b/python/tests/test_simulation.py index 271dc1617..8a550c18a 100644 --- a/python/tests/test_simulation.py +++ b/python/tests/test_simulation.py @@ -219,9 +219,12 @@ def init_simple_simulation(self, **kwargs): **kwargs, ) - @unittest.skipIf(not mp.with_mpi(), "MPI specific test") + @unittest.skipIf( + not mp.with_mpi() or mp.count_processors() < 2, + "MPI specific test (requires mpirun with more than 1 process)", + ) def test_mpi(self): - self.assertGreater(mp.comm.Get_size(), 1) + self.assertGreater(mp.count_processors(), 1) def test_use_output_directory_default(self): sim = self.init_simple_simulation()