2 # -*- coding: utf-8 -*-
10 os.environ['PYGTK_USE_GIL_STATE_API'] = ''
11 sys.path.insert(0, os.path.dirname(__file__))
12 sys.argv.append('--g-fatal-warnings')
14 from gi.repository import GObject
15 GObject.threads_init()
18 SKIP_FILES = ['runtests',
19 'test_mainloop', # no os.fork on windows
20 'test_subprocess'] # blocks on testChildWatch
23 if __name__ == '__main__':
24 testdir = os.path.split(os.path.abspath(__file__))[0]
28 files = glob.glob('*.py')
29 names = map(lambda x: x[:-3], files)
30 map(names.remove, SKIP_FILES)
33 suite = unittest.TestSuite()
34 loader = unittest.TestLoader()
36 for name in gettestnames():
38 suite.addTest(loader.loadTestsFromName(name))
40 print 'Could not load %s: %s' % (name, e)
42 testRunner = unittest.TextTestRunner()
43 testRunner.verbosity = 2