1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
import pytest
from parsl import python_app
from parsl.serialize.errors import SerializationError
from parsl.tests.configs.htex_local import fresh_config
def local_config():
config = fresh_config()
config.retries = 2
return config
@python_app
def fail_pickling(x):
return next(x)
def generator():
num = 0
while True:
yield num
num += 1
@pytest.mark.local
def test_serialization_error():
gen = generator()
x = fail_pickling(gen)
assert x.exception() is not None, "Should have got an exception, actually got: " + repr(x.result())
assert isinstance(x.exception(), SerializationError)
|