Example #1
0
def test_runner_wraps_error():
    def echo(i):
        return i

    assert wrap_to_ray_error(echo, 2) == 2

    def error(_):
        return 1 / 0

    assert isinstance(wrap_to_ray_error(error, 1), ray.exceptions.RayTaskError)
Example #2
0
def test_runner_wraps_error():
    wrapped = wrap_to_ray_error(Exception())
    assert isinstance(wrapped, ray.exceptions.RayTaskError)