Skip to content

Commit 937a7d7

Browse files
committed
In tests, when checking for completion, don't bail out when one of the
outputs isn't found, but attempt to read both.
1 parent 14c8556 commit 937a7d7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/_test_tools.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ def _read_file(path: Optional[Path]) -> str:
2828
if path is None:
2929
return ''
3030

31-
with open(path, 'r') as f:
32-
return f.read()
31+
try:
32+
with open(path, 'r') as f:
33+
return f.read()
34+
except FileNotFoundError as ex:
35+
return '<missing>'
36+
except Exception as ex:
37+
return f'<error: {ex}>'
3338

3439

3540
def assert_completed(job: Job, status: Optional[JobStatus], attached: bool = False) -> None:

0 commit comments

Comments
 (0)