Posted By

manatlan on 10/21/09


Tagged

python tech unittests


Versions (?)

Python unittests


 / Published in: Python
 

  1. import unittest
  2.  
  3. class TestSequenceFunctions(unittest.TestCase):
  4.  
  5. def setUp(self): pass
  6. def tearDown(self): pass
  7.  
  8. def test_assert(self):
  9. self.assert_( 1==1 )
  10.  
  11. def test_exceptions(self):
  12. self.assertRaises( ZeroDivisionError, lambda: 12/0 )
  13.  
  14. if __name__ == "__main__":
  15. unittest.main()

Report this snippet  

You need to login to post a comment.