diff --git a/tests/test_executor_backend_mpi.py b/tests/test_executor_backend_mpi.py index 3eef78f9..e0b4a3c5 100644 --- a/tests/test_executor_backend_mpi.py +++ b/tests/test_executor_backend_mpi.py @@ -128,3 +128,16 @@ def test_output_files_cwd(self): list(output), [1, 2, 3], ) + + +class TestSLURMExecutor(unittest.TestCase): + def test_validate_max_workers(self): + os.environ["SLURM_NTASKS"] = "6" + os.environ["SLURM_CPUS_PER_TASK"] = "4" + with self.assertRaises(ValueError): + Executor( + max_workers=10, + resource_dict={"cores": 10, "threads_per_core": 10}, + backend="slurm_allocation", + block_allocation=True, + )