summaryrefslogtreecommitdiff
path: root/tests/stdlib
diff options
context:
space:
mode:
authorRyan Williams <rdw@lindenlab.com>2009-11-28 18:50:12 -0500
committerRyan Williams <rdw@lindenlab.com>2009-11-28 18:50:12 -0500
commitcdfc4e171d228a2d832397cc879fd1ab44fc1122 (patch)
treeb62b51bef7c65d5fcbc7d9759b464783b2dd3a63 /tests/stdlib
parentb42db6044e18e789945ac4125a47eac8af95038e (diff)
downloadeventlet-cdfc4e171d228a2d832397cc879fd1ab44fc1122.tar.gz
Made the boundedsem test play nicer with the other tests...it still stomps on them though.
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/test_thread__boundedsem.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/stdlib/test_thread__boundedsem.py b/tests/stdlib/test_thread__boundedsem.py
index c1ca7c7..c530c61 100644
--- a/tests/stdlib/test_thread__boundedsem.py
+++ b/tests/stdlib/test_thread__boundedsem.py
@@ -5,8 +5,14 @@ from eventlet.green import thread
def allocate_lock():
return coros.semaphore(1, 9999)
+original_allocate_lock = thread.allocate_lock
thread.allocate_lock = allocate_lock
+original_LockType = thread.LockType
thread.LockType = coros.BoundedSemaphore
-import os.path
-execfile(os.path.join(os.path.dirname(__file__), 'test_thread.py'))
+try:
+ import os.path
+ execfile(os.path.join(os.path.dirname(__file__), 'test_thread.py'))
+finally:
+ thread.allocate_lock = original_allocate_lock
+ thread.LockType = original_LockType