Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import unittest
  2. class ts(unittest.TestCase):
  3. def test_null(self): self.assertTrue(True)
  4. if __name__ == '__main__': unittest.main()
  5.  
  6. import doctest
  7. import module1
  8. suite = doctest.DocTestSuite(module1)
  9.  
  10. import unittest
  11.  
  12.  
  13. class ts(unittest.TestCase):
  14. def test_null(self): self.assertTrue(True)
  15. class ts1(unittest.TestCase):
  16. def test_null(self): self.assertTrue(True)
  17.  
  18.  
  19.  
  20. testSuite = unittest.TestSuite()
  21.  
  22. testSuite.addTests(unittest.makeSuite(ts))
  23. testSuite.addTest(unittest.makeSuite(ts1))
  24.  
  25. import doctest
  26. import my_module_with_doctests
  27.  
  28. testSuite.addTest(doctest.DocTestSuite(my_module_with_doctests))
  29.  
  30. unittest.TextTestRunner(verbosity = 2).run(testSuite)
  31.  
  32. def load_tests(loader, tests, ignore):
  33. tests.addTests(doctest.DocTestSuite())
  34. return tests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement