Add python-eventlet 0.16.1
[packages/trusty/python-eventlet.git] / eventlet / tests / stdlib / test_thread__boundedsem.py
1 """Test that BoundedSemaphore with a very high bound is as good as unbounded one"""
2 from eventlet import semaphore
3 from eventlet.green import thread
4
5
6 def allocate_lock():
7     return semaphore.Semaphore(1, 9999)
8
9 original_allocate_lock = thread.allocate_lock
10 thread.allocate_lock = allocate_lock
11 original_LockType = thread.LockType
12 thread.LockType = semaphore.CappedSemaphore
13
14 try:
15     import os.path
16     execfile(os.path.join(os.path.dirname(__file__), 'test_thread.py'))
17 finally:
18     thread.allocate_lock = original_allocate_lock
19     thread.LockType = original_LockType