Skip to content

Commit

Permalink
Add tests that __cause__ is populated from the right exception
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Jan 15, 2025
1 parent faf4795 commit e269929
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parsl/tests/test_python_apps/test_fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def test_fail_sequence_first():
assert isinstance(t_final.exception().dependent_exceptions_tids[0][0], DependencyError)
assert t_final.exception().dependent_exceptions_tids[0][1].startswith("task ")

assert hasattr(t_final.exception(),'__cause__')
assert t_final.exception().__cause__ == t1.exception()


def test_fail_sequence_middle():
t1 = random_fail(fail_prob=0)
Expand All @@ -50,3 +53,6 @@ def test_fail_sequence_middle():

assert len(t_final.exception().dependent_exceptions_tids) == 1
assert isinstance(t_final.exception().dependent_exceptions_tids[0][0], ManufacturedTestFailure)

assert hasattr(t_final.exception(),'__cause__')
assert t_final.exception().__cause__ == t2.exception()

0 comments on commit e269929

Please sign in to comment.