File: testall.py

package info (click to toggle)
rpy 0.4.1-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,988 kB
  • ctags: 14,206
  • sloc: ansic: 15,392; python: 977; makefile: 406; sh: 28
file content (23 lines) | stat: -rw-r--r-- 491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import sys
import unittest
import random

def run(module):
    print 'Testing:', module[5:]
    try:
        unittest.main(module)
    except SystemExit:
        pass

if __name__ == '__main__':
    modules = os.listdir('.')

    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)