1 from eventlet import patcher
2 from eventlet.green import threading
3 from eventlet.green import thread
4 from eventlet.green import time
6 # *NOTE: doesn't test as much of the threading api as we'd like because many of
7 # the tests are launched via subprocess and therefore don't get patched
9 patcher.inject('test.test_threading',
12 # "PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently)
13 # exposed at the Python level. This test relies on ctypes to get at it."
14 # Therefore it's also disabled when testing eventlet, as it's not emulated.
16 ThreadTests.test_PyThreadState_SetAsyncExc = lambda s: None
17 except (AttributeError, NameError):
20 # disabling this test because it fails when run in Hudson even though it always
21 # succeeds when run manually
23 ThreadJoinOnShutdown.test_3_join_in_forked_from_thread = lambda *a, **kw: None
24 except (AttributeError, NameError):
27 # disabling this test because it relies on dorking with the hidden
28 # innards of the threading module in a way that doesn't appear to work
31 ThreadTests.test_limbo_cleanup = lambda *a, **kw: None
32 except (AttributeError, NameError):
35 # this test has nothing to do with Eventlet; if it fails it's not
36 # because of patching (which it does, grump grump)
38 ThreadTests.test_finalize_runnning_thread = lambda *a, **kw: None
39 # it's misspelled in the stdlib, silencing this version as well because
40 # inevitably someone will correct the error
41 ThreadTests.test_finalize_running_thread = lambda *a, **kw: None
42 except (AttributeError, NameError):
45 if __name__ == "__main__":