MCPcopy
hub / github.com/celery/celery / test_close_open_fds

Function test_close_open_fds

t/unit/utils/test_platforms.py:59–69  ·  view source on GitHub ↗
(patching)

Source from the content-addressed store, hash-verified

57
58
59def 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
72class test_ignore_errno:

Callers

nothing calls this directly

Calls 2

patchingFunction · 0.85
callFunction · 0.85

Tested by

no test coverage detected