def METHOD_NAME(monkeypatch):
    class MockQueue:
        items = []
        def get(self, timeout=None):
            try:
                return self.items.pop()
            except IndexError:
                if timeout:
                    raise queue.Empty()
                raise
        def put(self, item):
            self.items.append(item)
    mockqueue = MockQueue()
    monkeypatch.setattr('queue.Queue', lambda: mockqueue)
    return mockqueue