def test_generates_something(self): def generates_something(): i = 0 while True: yield i i += 1 self.assert_iter_equal(head(generates(generates_something()), 4), [0, 1, 2, 3])
def function(self, *args, **kw): return head(*args, **kw)