|
42 | 42 | import dask |
43 | 43 | import dask.bag as db |
44 | 44 | from dask import delayed |
45 | | -from dask._task_spec import no_function_cache |
46 | 45 | from dask.optimization import SubgraphCallable |
47 | 46 | from dask.tokenize import tokenize |
48 | 47 | from dask.utils import get_default_shuffle_method, parse_timedelta, tmpfile |
@@ -4934,29 +4933,27 @@ def __setstate__(self, state): |
4934 | 4933 |
|
4935 | 4934 | @gen_cluster(client=True) |
4936 | 4935 | async def test_robust_undeserializable_function(c, s, a, b, monkeypatch): |
4937 | | - with no_function_cache(): |
4938 | | - |
4939 | | - class Foo: |
4940 | | - def __getstate__(self): |
4941 | | - return 1 |
| 4936 | + class Foo: |
| 4937 | + def __getstate__(self): |
| 4938 | + return 1 |
4942 | 4939 |
|
4943 | | - def __setstate__(self, state): |
4944 | | - raise MyException("hello") |
| 4940 | + def __setstate__(self, state): |
| 4941 | + raise MyException("hello") |
4945 | 4942 |
|
4946 | | - def __call__(self, *args): |
4947 | | - return 1 |
| 4943 | + def __call__(self, *args): |
| 4944 | + return 1 |
4948 | 4945 |
|
4949 | | - future = c.submit(Foo(), 1) |
4950 | | - await wait(future) |
4951 | | - assert future.status == "error" |
4952 | | - with raises_with_cause(RuntimeError, "deserialization", MyException, "hello"): |
4953 | | - await future |
| 4946 | + future = c.submit(Foo(), 1) |
| 4947 | + await wait(future) |
| 4948 | + assert future.status == "error" |
| 4949 | + with raises_with_cause(RuntimeError, "deserialization", MyException, "hello"): |
| 4950 | + await future |
4954 | 4951 |
|
4955 | | - futures = c.map(inc, range(10)) |
4956 | | - results = await c.gather(futures) |
| 4952 | + futures = c.map(inc, range(10)) |
| 4953 | + results = await c.gather(futures) |
4957 | 4954 |
|
4958 | | - assert results == list(map(inc, range(10))) |
4959 | | - assert a.data and b.data |
| 4955 | + assert results == list(map(inc, range(10))) |
| 4956 | + assert a.data and b.data |
4960 | 4957 |
|
4961 | 4958 |
|
4962 | 4959 | @gen_cluster(client=True) |
|
0 commit comments