def test_get_response_returns_none_when_queue_is_empty(self):
        queues = []

        def _side_effect():
            q = mock.MagicMock()
            q.get_nowait.side_effect = queue.Empty()
            queues.append(q)
            return q

        with mock.patch.object(queue, 'Queue', side_effect=_side_effect):
            with mock.patch.object(thread, 'SessionThread'):
                p = pool.Pool(None)

        assert len(queues) == 2

        assert p.get_response() is None
        assert len([q for q in queues if q.get_nowait.called]) == 1
Ensure that None is returned when the response Queue is empty.
dataset/ETHPy150Open sigmavirus24/requests-toolbelt/tests/threaded/test_pool.py/TestPool.test_get_response_returns_none_when_queue_is_empty