unittest module
A Simple Test Using the unittest Framework
import unittest, my_math
# w ww . j a va 2 s .com
class ProductTestCase(unittest.TestCase):
def testIntegers(self):
self.failUnless(1 == 2, 'Integer multiplication failed')
def testFloats(self):
self.failUnless(1.1 == 2.2, 'Float multiplication failed')
unittest.main()