async def test_connection_pool_blocks_until_timeout(self, master_host):
        """When out of connections, block for timeout seconds, then raise"""
        connection_kwargs = {"host": master_host}
        pool = self.get_pool(
            max_connections=1, timeout=0.1, connection_kwargs=connection_kwargs
        )
        await pool.get_connection("_")

        start = asyncio.get_event_loop().time()
        with pytest.raises(aioredis.ConnectionError):
            await pool.get_connection("_")
        # we should have waited at least 0.1 seconds
        assert asyncio.get_event_loop().time() - start >= 0.1
When out of connections, block for timeout seconds, then raise
tests/test_connection_pool.py