Python unittests : turning old tests in unittest cases


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. import unittest
  2.  
  3. @unittest.FunctionTestCase
  4. def old_tests():
  5. assert 1==1
  6.  
  7. if __name__ == "__main__":
  8. suite = unittest.TestSuite()
  9. suite.addTest( old_tests )
  10.  
  11. unittest.TextTestRunner().run( suite )

Report this snippet


Comments


You need to login to view comments.