X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=eventlet%2Ftests%2Fstdlib%2Fall.py;fp=eventlet%2Ftests%2Fstdlib%2Fall.py;h=0000000000000000000000000000000000000000;hb=358bd9258c2b6d2ee74de4dfd07a5123107abad4;hp=3d05d1e6d6eb710a012127ca474de2d63559deb4;hpb=376ff3bfe7071cc0793184a378c4e74508fb0d97;p=packages%2Ftrusty%2Fpython-eventlet.git diff --git a/eventlet/tests/stdlib/all.py b/eventlet/tests/stdlib/all.py deleted file mode 100644 index 3d05d1e..0000000 --- a/eventlet/tests/stdlib/all.py +++ /dev/null @@ -1,51 +0,0 @@ -""" 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. - -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. -""" - -from eventlet import debug -debug.hub_prevent_multiple_readers(False) - - -def restart_hub(): - from eventlet import hubs - hub = hubs.get_hub() - hub_shortname = hub.__module__.split('.')[-1] - # don't restart the pyevent hub; it's not necessary - if hub_shortname != 'pyevent': - hub.abort() - hubs.use_hub(hub_shortname) - - -def assimilate_patched(name): - try: - modobj = __import__(name, globals(), locals(), ['test_main']) - restart_hub() - except ImportError: - print("Not importing %s, it doesn't exist in this installation/version of Python" % name) - return - else: - method_name = name + "_test_main" - try: - test_method = modobj.test_main - - def test_main(): - restart_hub() - test_method() - restart_hub() - globals()[method_name] = test_main - test_main.__name__ = name + '.test_main' - except AttributeError: - print("No test_main for %s, assuming it tests on import" % name) - -import all_modules - -for m in all_modules.get_modules(): - assimilate_patched(m)