File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ venv.bak/
108108
109109# vscode files
110110.vscode /
111- .vscode /settings.json
111+ # .vscode/settings.json
112112
113113# IDEA files
114114.idea /
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55
66class Test_Demo (unittest .TestCase ):
77 ''' the test demo '''
8+
89 @classmethod
910 def setUpClass (cls ):
1011 print ("...the set up..." )
11- print
12+ print ( '' )
1213
1314 def setUp (self ):
14- return super (Test_Demo , self ).setUp ()
15+ super (Test_Demo , self ).setUp ()
1516
1617 def _xxx (self ):
17- print "the test xxx is succeed."
18+ print ( "the test xxx is succeed." )
1819 pass
1920
2021 def test_xxx (self ):
21- print "the test xxx is succeed."
22+ print ( "the test xxx is succeed." )
2223 pass
2324
2425 def tearDown (self ):
25- return super (Test_Demo , self ).tearDown ()
26+ super (Test_Demo , self ).tearDown ()
2627
2728 @classmethod
2829 def tearDownClass (cls ):
29- print
30+ print ( '' )
3031 print ("...the tear down..." )
3132
3233
3334if __name__ == '__main__' :
35+ ''' the unittest suite '''
36+ suite = unittest .TestLoader ().loadTestsFromTestCase (Test_Demo )
37+ unittest .TextTestRunner (verbosity = 2 ).run (suite )
3438 unittest .main ()
Original file line number Diff line number Diff line change 22
33
44class Template (object ):
5- 'the Template class'
5+ ''' the Template class'' '
66
77 def __init__ (self ):
88 super (Template , self ).__init__ ()
Original file line number Diff line number Diff line change 55
66class Test_XXX (unittest .TestCase ):
77 ''' the test xxx '''
8+
89 @classmethod
910 def setUpClass (cls ):
1011 print ("...the set up..." )
11- print
12+ print ( '' )
1213
1314 def setUp (self ):
14- return super (Test_XXX , self ).setUp ()
15+ super (Test_XXX , self ).setUp ()
1516
1617 def test_xxx (self ):
1718 print ("the test xxx(test_template.py) is succeed." )
1819 pass
1920
2021 def tearDown (self ):
21- return super (Test_XXX , self ).tearDown ()
22+ super (Test_XXX , self ).tearDown ()
2223
2324 @classmethod
2425 def tearDownClass (cls ):
25- print
26+ print ( '' )
2627 print ("...the tear down..." )
2728
2829
2930if __name__ == '__main__' :
30- unittest .main ()
31+ ''' the unittest suite '''
32+ suite = unittest .TestLoader ().loadTestsFromTestCase (Test_XXX )
33+ unittest .TextTestRunner (verbosity = 2 ).run (suite )
34+ # unittest.main()
You can’t perform that action at this time.
0 commit comments