From b156e1c803f78ad89b532a38a2483146a6e4937d Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Mon, 11 Nov 2024 21:34:04 +0100 Subject: [PATCH] Add test for error --- tests/test_local_executor.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_local_executor.py b/tests/test_local_executor.py index 44131fa1..62c49502 100644 --- a/tests/test_local_executor.py +++ b/tests/test_local_executor.py @@ -504,3 +504,21 @@ def test_execute_task_cache(self): ) self.assertEqual(f.result(), 1) q.join() + + @unittest.skipIf( + skip_h5py_test, "h5py is not installed, so the h5py tests are skipped." + ) + def test_execute_task_cache_failed_no_argument(self): + f = Future() + q = Queue() + q.put({"fn": calc_array, "args": (), "kwargs": {}, "future": f}) + cloudpickle_register(ind=1) + with self.assertRaises(TypeError): + execute_parallel_tasks( + future_queue=q, + cores=1, + openmpi_oversubscribe=False, + spawner=MpiExecSpawner, + cache_directory="./cache", + ) + q.join() \ No newline at end of file