Exemple #1
0
    async def test_should_raise_would_block_error_when_using_get_nowait_on_empty_buffer(
            self):
        queue = Queue()

        with pytest.raises(anyio.WouldBlock):
            queue.get_nowait()
Exemple #2
0
    async def test_should_work_when_using_get_nowait_method(self):
        queue = Queue(3, items=[2, 'foo'])

        assert 2 == queue.get_nowait()
        assert 'foo' == queue.get_nowait()