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 os
import sys
import testtools.run
import unittest2
class TestProgram(testtools.run.TestProgram):
def __init__(self, module, argv, stdout=None, testRunner=None, exit=True):
if testRunner is None:
testRunner = unittest2.TextTestRunner
super(TestProgram, self).__init__(module, argv=argv, stdout=stdout,
testRunner=testRunner, exit=exit)
# We discover tests under tests, the python 'load_test' protocol
# can be used in test modules for more fancy stuff.
discover_args = ['discover',
'--start-directory', './tests',
'--top-level-directory', '.',
]
TestProgram(__name__, argv=[sys.argv[0]] + discover_args + sys.argv[1:])
|