Example #1
0
    async def test_sync_join(self):
        p = BarrierState(reply_to='rt')
        assert not p.pending
        assert p.size == 0

        await self.adder(p)
        await self.fulfiller(p)
        await self.finalizer(p, 0.0)
        await self.joiner(p)
        assert p.get_nowait()
Example #2
0
 async def test_get_nowait__exhaust_sentinels(self):
     p = BarrierState(reply_to='rt')
     for _ in range(20):
         p._results.put_nowait(None)
     with pytest.raises(asyncio.QueueEmpty):
         p.get_nowait()