File: test_lazy_suite.py

package info (click to toggle)
nose 1.3.7-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,900 kB
  • sloc: python: 15,733; makefile: 99; xml: 42; sh: 2
file content (21 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import unittest
from nose.suite import LazySuite
from helpers import iter_compat

def gen():
    for x in range(0, 10):
        yield TestLazySuite.TC('test')

class TestLazySuite(unittest.TestCase):

    class TC(unittest.TestCase):
        def test(self):
            pass
        
    def test_basic_iteration(self):        
        ls = LazySuite(gen)
        for t in iter_compat(ls):
            assert isinstance(t, unittest.TestCase)
        
if __name__ == '__main__':
    unittest.main()