-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollectingResults.py
58 lines (39 loc) · 1.44 KB
/
collectingResults.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import unittest,logging
log = logging.getLogger(__name__)
logging.basicConfig(filename="C:\git\myProject\log.txt",level=logging.DEBUG,)
class TestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
log.info("This is the Common setup")
@classmethod
def tearDownClass(cls):
log.info("This is the Common clean up.")
def setUp(self):
log.info("This is the Test Case Setup section!!")
def test_testCase1_1(self):
log.info("This is the test case 1 of 1 ")
def test_testCase2_1(self):
log.info("This is the test case 2 of 1")
def tearDown(self):
log.info("This is the Test Case Tear down section!!")
class TestCase2(unittest.TestCase):
@classmethod
def setUpClass(cls):
log.info("This is the Common setup")
@classmethod
def tearDownClass(cls):
log.info("This is the Common clean up.")
def setUp(self):
log.info("This is the Test Case Setup section!!")
def test_testCase1_2(self):
log.info("This is the test case of 2 ")
def test_testCase2_2(self):
log.info("This is the test case 2 of 2")
def tearDown(self):
log.info("This is the Test Case Tear down section!!")
if __name__ == '__main__':
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestCase))
# suite.addTest(unittest.makeSuite(TestCase2))
runner = unittest.TextTestRunner()
results = runner.run(suite)