1 """ Convenience module for running standard library tests with nose. The standard tests are not especially homogeneous, but they mostly expose a test_main method that does the work of selecting which tests to run based on what is supported by the platform. On its own, Nose would run all possible tests and many would fail; therefore we collect all of the test_main methods here in one module and Nose can run it. Hopefully in the future the standard tests get rewritten to be more nosey.
3 Many of these tests make connections to external servers, and all.py tries to skip these tests rather than failing them, so you can get some work done on a plane.
6 from eventlet import debug
7 debug.hub_prevent_multiple_readers(False)
11 from eventlet import hubs
13 hub_shortname = hub.__module__.split('.')[-1]
14 # don't restart the pyevent hub; it's not necessary
15 if hub_shortname != 'pyevent':
17 hubs.use_hub(hub_shortname)
20 def assimilate_patched(name):
22 modobj = __import__(name, globals(), locals(), ['test_main'])
25 print("Not importing %s, it doesn't exist in this installation/version of Python" % name)
28 method_name = name + "_test_main"
30 test_method = modobj.test_main
36 globals()[method_name] = test_main
37 test_main.__name__ = name + '.test_main'
38 except AttributeError:
39 print("No test_main for %s, assuming it tests on import" % name)
43 for m in all_modules.get_modules():