def test_get_colours(): gen = colour.get_colours() expect = ['cyan', 'yellow', 'green', 'magenta', 'red', 'blue'] expect = [getattr(colour, x) for x in expect] actual = [next(gen) for _ in compat.xrange(6)] assert expect == actual
def test_get_colours(): gen = colour.get_colours() expect = ['cyan', 'yellow', 'green', 'magenta', 'red', 'blue'] expect = [getattr(colour, x) for x in expect] actual = [gen.next() for _ in xrange(6)] assert_equal(expect, actual)