Skip to content

Commit cfed47e

Browse files
committed
rework exception tests to be BasicMemoizer tests
because different memoizers (and different BasicMemoizer configs) won't necessarily have the identity semantics tested here
1 parent 37fefac commit cfed47e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

parsl/tests/test_python_apps/test_memoize_exception.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
import pytest
2+
13
import parsl
24
from parsl.app.app import python_app
5+
from parsl.config import Config
6+
from parsl.dataflow.memoization import BasicMemoizer
7+
from parsl.executors.threads import ThreadPoolExecutor
8+
9+
10+
def local_config():
11+
return Config(
12+
executors=[ThreadPoolExecutor()],
13+
memoizer=BasicMemoizer()
14+
)
315

416

517
@python_app(cache=True)
@@ -12,8 +24,9 @@ def raise_exception_nocache(x, cache=True):
1224
raise RuntimeError("exception from raise_exception_nocache")
1325

1426

27+
@pytest.mark.local
1528
def test_python_memoization(n=2):
16-
"""Test Python memoization of exceptions, with cache=True"""
29+
"""Test BasicMemoizer memoization of exceptions, with cache=True"""
1730
x = raise_exception_cache(0)
1831

1932
# wait for x to be done
@@ -27,8 +40,9 @@ def test_python_memoization(n=2):
2740
assert fut.exception() is x.exception(), "Memoized exception should have been memoized"
2841

2942

43+
@pytest.mark.local
3044
def test_python_no_memoization(n=2):
31-
"""Test Python non-memoization of exceptions, with cache=False"""
45+
"""Test BasicMemoizer non-memoization of exceptions, with cache=False"""
3246
x = raise_exception_nocache(0)
3347

3448
# wait for x to be done

0 commit comments

Comments
 (0)