(patching)
| 57 | |
| 58 | |
| 59 | def test_close_open_fds(patching): |
| 60 | _close = patching('os.close') |
| 61 | fdmax = patching('billiard.compat.get_fdmax') |
| 62 | with patch('os.closerange', create=True) as closerange: |
| 63 | fdmax.return_value = 3 |
| 64 | close_open_fds() |
| 65 | if not closerange.called: |
| 66 | _close.assert_has_calls([call(2), call(1), call(0)]) |
| 67 | _close.side_effect = OSError() |
| 68 | _close.side_effect.errno = errno.EBADF |
| 69 | close_open_fds() |
| 70 | |
| 71 | |
| 72 | class test_ignore_errno: |