pytest-dev / py

Python development support library (note: maintenance only)
MIT License
68 stars 104 forks source link

Fix ForkedFunc to handle hard exit(0) #262

Open vermaport opened 4 years ago

vermaport commented 4 years ago
  1. waitfinish() assumes that if the forked child process exited with exitstatus == 0, that _child() ran to completion and wrote out the retval. This is not true if the function run in the child process hard exited with status 0, e.g. os._exit(0) (or even sys.exit(0)).

  2. Add new unit test test_exit0() for this case.

  3. Fixes #261