Exemple #1
0
    def testIsGeneratorYes(self):
        def giveme():  # pragma: no cover
            for i in range(3):
                yield i

        g = giveme()
        assert isgenerator(g)
Exemple #2
0
 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
Exemple #3
0
 def testIsGeneratorNo(self):
     def giveme():
         return 5
     assert not isgenerator(giveme())
Exemple #4
0
 def testIsGeneratorYes(self):
     def giveme(): # pragma: no cover
         for i in range(3):
             yield i
     g = giveme()
     assert isgenerator(g)
Exemple #5
0
    def testIsGeneratorNo(self):
        def giveme():
            return 5

        assert not isgenerator(giveme())