-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathtest.py
More file actions
51 lines (43 loc) · 1010 Bytes
/
test.py
File metadata and controls
51 lines (43 loc) · 1010 Bytes
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
import sys
import unittest
import doctest
# all of the testable modules
# when another module needs to be incorporated into tests
# they should be added here
import cogs.basic
import cogs.courseInfo
import cogs.number_utils
import cogs.gpa
import cogs.manpage
import cogs.markov
import cogs.hyphen
import cogs.crob
import cogs.starboard
import cogs.invite_checker
test_modules = [
cogs.basic,
cogs.courseInfo,
cogs.number_utils,
cogs.gpa,
cogs.manpage,
cogs.markov,
cogs.hyphen,
cogs.crob,
cogs.starboard,
cogs.invite_checker
]
def load_tests(tests):
# add each of the test modules
for mod in test_modules:
tests.addTests(doctest.DocTestSuite(mod))
return tests
if __name__ == '__main__':
"""
runs the tests
"""
tests = unittest.TestSuite()
test = load_tests(tests)
runner = unittest.TextTestRunner()
# get the exit code and return when failed
ret = not runner.run(tests).wasSuccessful()
sys.exit(ret)