def testIsGeneratorYes(self): def giveme(): # pragma: no cover for i in range(3): yield i g = giveme() assert isgenerator(g)
def testIsGeneratorYes(self): def giveme(): for i in range(3): yield i g = giveme() assert isgenerator(g) for i in g: pass # just to get coverage on the givme function
def testIsGeneratorNo(self): def giveme(): return 5 assert not isgenerator(giveme())