2019独角兽企业重金招聘Python工程师标准>>>
import unittest
class WidgetTestCase(unittest.TestCase):
def setUp(self):
self.size = 4
def tearDown(self):
self.size = 0
def testSize(self):
self.assertEqual(self.size, 4)
def suite():
suite = unittest.TestSuite()
suite.addTest(WidgetTestCase("testSize"))
return suite
if __name__ == "__main__":
unittest.main(defaultTest = 'suite')