Skip to content

Commit

Permalink
Update datalad_next/iterable_subprocess/test_iterable_subprocess.py
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Hanke <michael.hanke@gmail.com>
  • Loading branch information
christian-monch and mih authored Feb 2, 2024
1 parent b83c101 commit d1fc39f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions datalad_next/iterable_subprocess/test_iterable_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,11 @@ def test_returncode_available_from_generator_with_exception():
with iterable_subprocess(['echo', 'a'], ()) as echo:
while True:
next(echo)
# On a Linux system, all exceptions that are raised before the subprocess
# exited will lead to a -15 return code. If StopIteration is raised, the
# subprocess will either have terminated which results in a 0-return code,
# or the subprocess is still running and will therefore be terminated which
# results in a -15 return code. Any other exception than StopIteration,
# e.g. a CommandError because echo could not be found, would lead to an
# early test-exit and not proceed to the assign-statement.
assert echo.returncode in (0, -15)

0 comments on commit d1fc39f

Please sign in to comment.