File: runtests.py

package info (click to toggle)
gnome-python-extras 2.14.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,756 kB
  • ctags: 731
  • sloc: sh: 8,856; ansic: 5,011; xml: 1,319; python: 725; makefile: 415
file content (25 lines) | stat: -rw-r--r-- 539 bytes parent folder | download | duplicates (7)
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
#!/usr/bin/env python
import glob
import os
import sys
import unittest
import common

SKIP_FILES = ['common', 'runtests']

dir = os.path.split(os.path.abspath(__file__))[0]
os.chdir(dir)

def gettestnames():
    files = [fname[:-3] for fname in glob.glob('test*.py')
             if fname not in SKIP_FILES]
    return files
        
suite = unittest.TestSuite()
loader = unittest.TestLoader()

for name in gettestnames():
    suite.addTest(loader.loadTestsFromName(name))
    
testRunner = unittest.TextTestRunner()
testRunner.run(suite)