Skip to content

Commit

Permalink
errors with local backend
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Dec 22, 2024
1 parent 2ce2a52 commit 481c9ea
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_dependencies_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def merge(lst):
return sum(lst)


def raise_error():
raise RuntimeError


class TestExecutorWithDependencies(unittest.TestCase):
def test_executor(self):
with Executor(max_cores=1, backend="local") as exe:
Expand Down Expand Up @@ -227,3 +231,17 @@ def test_many_to_one_plot(self):
)
self.assertEqual(len(nodes), 18)
self.assertEqual(len(edges), 21)


class TestExecutorErrors(unittest.TestCase):
def test_block_allocation_false(self):
with self.assertRaises(RuntimeError):
with Executor(max_cores=1, backend="local", block_allocation=False) as exe:
cloudpickle_register(ind=1)
_ = exe.submit(raise_error)

def test_block_allocation_true(self):
with self.assertRaises(RuntimeError):
with Executor(max_cores=1, backend="local", block_allocation=True) as exe:
cloudpickle_register(ind=1)
_ = exe.submit(raise_error)

0 comments on commit 481c9ea

Please sign in to comment.