The title pretty much sums it up: I tried to use assertEqual to test a function that returns a generator object, but that results in:
AssertionError: gene
assertEqual(tuple(generator_object), (1, 2, ...))
if it's an infinite generator, or you just wish to look at the first n results for some reason, you can combint this with itertools.islice
n
itertools.islice
assertEqual(tuple(islice(generator_object, n)), (1, 2, ...))