13
13
append_path = False
14
if __name__ != "__main__":
14
if __name__ != '__main__':
15
15
prefix = __name__[:-5]
19
20
# If we are not called directly, we have
20
21
# to append this path to sys.path so our
21
22
# subtests will find their files
22
23
this_dir = os.path.dirname(__file__)
24
sys.path.append( this_dir )
25
sys.path.append(this_dir)
26
27
suite = unittest.TestSuite()
27
28
l = unittest.TestLoader()
29
30
dname = os.path.dirname(__file__)
31
for f in glob("%s/utest/*.py" % dname):
32
for f in glob('%s/utest/*.py' % dname):
32
33
if os.path.basename(f) == '__init__.py':
35
modname = "%sutest.%s" % (prefix,os.path.basename(f)[:-3])
36
modname = '%sutest.%s' % (prefix, os.path.basename(f)[:-3])
38
tests = l.loadTestsFromName( modname )
39
tests = l.loadTestsFromName(modname)
39
40
suite.addTests(tests)
42
sys.path.remove( this_dir )
43
sys.path.remove(this_dir)
48
50
runner = unittest.TextTestRunner()
50
52
return unittest.TestResult()
54
55
if __name__ == '__main__':