-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodel_controller_test.py
More file actions
28 lines (26 loc) · 1.29 KB
/
model_controller_test.py
File metadata and controls
28 lines (26 loc) · 1.29 KB
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
import unittest
from AI_player_test import AIPlayerTestCase
from card_test import CardTestCase
from controller_test import ControllerTestCase
from player_test import PlayerTestCase
if __name__ == '__main__':
try:
from HtmlTestRunner import HTMLTestRunner
except ImportError:
unittest.main()
else:
suite = unittest.TestSuite()
for test_case_class in (CardTestCase, PlayerTestCase, AIPlayerTestCase, ControllerTestCase):
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(test_case_class))
# suite.addTests(unittest.TestLoader().loadTestsFromTestCase(ControllerTestCase))
# 生成测试报告
with open('HTMLReport.html', 'w') as f:
runner = HTMLTestRunner(output='Model Controller Test',
report_title='Model & Controller Test Report',
descriptions='this is a report '
'generated by HTMLTestRunner, '
'which can be installed using '
'"pip install html-testrunner"',
verbosity=2, stream=f)
runner.run(suite)
f.flush()