/unit_tests/test_lazy_suite.py

https://bitbucket.org/jpellerin/nose/ · Python · 21 lines · 16 code · 5 blank · 0 comment · 3 complexity · 226e9e6f479b01a0e97ba6417fea35c2 MD5 · raw file

  1. import unittest
  2. from nose.suite import LazySuite
  3. from helpers import iter_compat
  4. def gen():
  5. for x in range(0, 10):
  6. yield TestLazySuite.TC('test')
  7. class TestLazySuite(unittest.TestCase):
  8. class TC(unittest.TestCase):
  9. def test(self):
  10. pass
  11. def test_basic_iteration(self):
  12. ls = LazySuite(gen)
  13. for t in iter_compat(ls):
  14. assert isinstance(t, unittest.TestCase)
  15. if __name__ == '__main__':
  16. unittest.main()