def test_generator(self): iterable = MockGenerator([1, 2, 3]) repeated = repeat(iterable, 3) assert iterable.evaluated == 0 list(repeated) assert iterable.evaluated == 3 * 3
def test_result(self): iterable = range(14) repeated = repeat(iterable, 3) assert list(repeated) == list(iterable) * 3