forked from xmao/kobas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
29 lines (22 loc) · 680 Bytes
/
test.py
File metadata and controls
29 lines (22 loc) · 680 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
#!/usr/bin/python
""" Unit test gilet for all the test script, borrown from rpy"""
import os, sys
import random
import unittest
def run(module):
print 'Testing:', module[4:]
try:
unittest.main('kobas.tests.%s' % module)
except SystemExit:
pass
if __name__ == '__main__':
sys.path.insert(0, 'src')
import kobas.tests
modules = os.listdir(os.path.dirname(kobas.tests.__file__))
if '--random' in sys.argv:
random.shuffle(modules)
sys.argv.remove('--random')
for module in modules:
if module.startswith('Test') and not module.endswith('.pyc'):
name = module[:-3]
run(name)