21 lines
467 B
Python
Raw Normal View History

2022-08-06 23:26:04 +08:00
import unittest
class TestUnittestAssertions(unittest.TestCase):
def testEqual(self):
print("in testEqual...")
2022-08-06 23:26:04 +08:00
self.assertEqual(0, 0)
def testTrue(self):
print("in testTrue...")
2022-08-06 23:26:04 +08:00
self.assertTrue(True)
def testFalse(self):
print("in testFalse...")
2022-08-06 23:26:04 +08:00
self.assertFalse(False)
2022-08-11 18:32:53 +08:00
suit = unittest.TestSuite("test1")
2022-08-06 23:26:04 +08:00
suit.addTest(TestUnittestAssertions())
runner = unittest.TextTestRunner()
2022-08-11 19:21:53 +08:00
res = runner.run(suit)