pytest
requirements.txt
pytest
unitTest.py
1 import unittest
2
3 class SimpleTestCase(unittest.TestCase):
4 def setUp(self):
5 self.res=4
6
7 def tearDown(self):
8 self.res=0
9
10 def testAdd1(self):
11 res=2+2
12 self.assertEqual(self.res,res,'')
13
14 def testAdd2(self):
15 res=2+3
16 self.assertEqual(self.res,res,'')
17
18 def testAdd3(self):
19 res=2+3
20 self.assertNotEqual(self.res,res,'')