1import os
2import sys
3import unittest
4
5
6here = os.path.dirname(__file__)
7loader = unittest.defaultTestLoader
8
9def load_tests(*args):
10    suite = unittest.TestSuite()
11    for fn in os.listdir(here):
12        if fn.startswith("test") and fn.endswith(".py"):
13            modname = "unittest.test.testmock." + fn[:-3]
14            __import__(modname)
15            module = sys.modules[modname]
16            suite.addTest(loader.loadTestsFromModule(module))
17    return suite
18