MCPcopy Create free account
hub / github.com/openai/openai-python / test_flush_async

Method test_flush_async

tests/test_send_queue.py:75–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73
74 @pytest.mark.asyncio
75 async def test_flush_async(self) -> None:
76 q = SendQueue()
77 q.enqueue("a")
78 q.enqueue("b")
79
80 sent: list[str] = []
81
82 async def async_send(data: str) -> None:
83 sent.append(data)
84
85 await q.flush_async(async_send)
86 assert sent == ["a", "b"]
87 assert len(q) == 0
88
89 @pytest.mark.asyncio
90 async def test_flush_async_requeues_on_failure(self) -> None:

Callers

nothing calls this directly

Calls 3

enqueueMethod · 0.95
flush_asyncMethod · 0.95
SendQueueClass · 0.90

Tested by

no test coverage detected