2010-03-27 09:34:21 -03:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
here = os.path.dirname(__file__)
|
|
|
|
loader = unittest.defaultTestLoader
|
|
|
|
|
2010-03-27 10:45:04 -03:00
|
|
|
def suite():
|
2010-03-27 09:34:21 -03:00
|
|
|
suite = unittest.TestSuite()
|
|
|
|
for fn in os.listdir(here):
|
|
|
|
if fn.startswith("test") and fn.endswith(".py"):
|
|
|
|
modname = "unittest.test." + fn[:-3]
|
2022-03-22 07:04:36 -03:00
|
|
|
try:
|
|
|
|
__import__(modname)
|
|
|
|
except unittest.SkipTest:
|
|
|
|
continue
|
2010-03-27 09:34:21 -03:00
|
|
|
module = sys.modules[modname]
|
|
|
|
suite.addTest(loader.loadTestsFromModule(module))
|
2012-03-14 16:24:34 -03:00
|
|
|
suite.addTest(loader.loadTestsFromName('unittest.test.testmock'))
|
2010-03-27 09:34:21 -03:00
|
|
|
return suite
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2010-03-27 10:45:04 -03:00
|
|
|
unittest.main(defaultTest="suite")
|