Issue #7270: Add some dedicated unit tests for multi-thread synchronization

primitives such as Lock, RLock, Condition, Event and Semaphore.
This commit is contained in:
Antoine Pitrou 2009-11-06 22:34:35 +00:00
parent 17f0f692ee
commit c98efe0500
4 changed files with 571 additions and 18 deletions

View file

@ -6,6 +6,7 @@ import thread
import time
import weakref
from test import lock_tests
NUMTASKS = 10
NUMTRIPS = 3
@ -191,8 +192,12 @@ class BarrierTest(BasicThreadTest):
self.done_mutex.release()
class LockTests(lock_tests.LockTests):
locktype = thread.allocate_lock
def test_main():
test_support.run_unittest(ThreadRunningTests, BarrierTest)
test_support.run_unittest(ThreadRunningTests, BarrierTest, LockTests)
if __name__ == "__main__":
test_main()