2013-10-17 17:40:50 -03:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import unittest
|
2013-11-17 21:00:21 -04:00
|
|
|
from test.support import run_unittest, import_module
|
2013-10-17 17:40:50 -03:00
|
|
|
|
2013-11-17 21:00:21 -04:00
|
|
|
# Skip tests if we don't have threading.
|
|
|
|
import_module('threading')
|
|
|
|
# Skip tests if we don't have concurrent.futures.
|
|
|
|
import_module('concurrent.futures')
|
2013-10-19 12:47:26 -03:00
|
|
|
|
2013-10-17 17:40:50 -03:00
|
|
|
|
|
|
|
def suite():
|
|
|
|
tests = unittest.TestSuite()
|
|
|
|
loader = unittest.TestLoader()
|
2014-03-27 13:21:20 -03:00
|
|
|
for fn in os.listdir(os.path.dirname(__file__)):
|
|
|
|
if fn.startswith("test") and fn.endswith(".py"):
|
|
|
|
mod_name = 'test.test_asyncio.' + fn[:-3]
|
|
|
|
try:
|
|
|
|
__import__(mod_name)
|
|
|
|
except unittest.SkipTest:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
mod = sys.modules[mod_name]
|
|
|
|
tests.addTests(loader.loadTestsFromModule(mod))
|
2013-10-17 17:40:50 -03:00
|
|
|
return tests
|
|
|
|
|
|
|
|
|
|
|
|
def test_main():
|
|
|
|
run_unittest(suite())
|