def test_chunk_invalid(n): with pytest.raises(ValueError): list(utils.chunk([], n))
def test_chunk(elems, n, expected): assert list(utils.chunk(elems, n)) == expected