summaryrefslogtreecommitdiff
path: root/tests/stdlib/test_thread.py
diff options
context:
space:
mode:
authorRyan Williams <rdw@lindenlab.com>2009-09-02 09:32:39 -0700
committerRyan Williams <rdw@lindenlab.com>2009-09-02 09:32:39 -0700
commit215803e429bc0013d0a60bea8cf8ad8506a32290 (patch)
tree4aab6d135e5865feec9fb8ba7d2f274010b9e132 /tests/stdlib/test_thread.py
parentab419feb736e8fb0094810fbca5cf11361119ac7 (diff)
downloadeventlet-215803e429bc0013d0a60bea8cf8ad8506a32290.tar.gz
Replaced copy-and-paste test_thread with patched thread test.
Diffstat (limited to 'tests/stdlib/test_thread.py')
-rw-r--r--tests/stdlib/test_thread.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/stdlib/test_thread.py b/tests/stdlib/test_thread.py
new file mode 100644
index 0000000..d1a2880
--- /dev/null
+++ b/tests/stdlib/test_thread.py
@@ -0,0 +1,20 @@
+from eventlet.green import thread
+from eventlet.green import time
+
+# necessary to initialize the hub before running on 2.5
+from eventlet import api
+api.get_hub()
+
+# in Python < 2.5, the import does all the testing,
+# so we have to wrap that in test_main as well
+def test_main():
+ import sys
+ sys.modules['thread'] = thread
+ sys.modules['time'] = time
+ from test import test_thread
+ if hasattr(test_thread, 'test_main'):
+ # > 2.6
+ test_thread.test_main()
+
+if __name__ == "__main__":
+ test_main() \ No newline at end of file