def test_clean_fds_rlimit(self, close_mock):
"""
L{clean_fds} cleans all non-stdio file descriptors up to the process
limit for file descriptors.
"""
with self.mock_getrlimit(10) as getrlimit_mock:
clean_fds()
calls = [call(i) for i in range(3, 10)]
close_mock.assert_has_calls(calls, any_order=True)
getrlimit_mock.assert_called_once_with(resource.RLIMIT_NOFILE)
评论列表
文章目录