mirror of
https://github.com/python/cpython.git
synced 2025-09-15 05:06:12 +00:00
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:
parent
17f0f692ee
commit
c98efe0500
4 changed files with 571 additions and 18 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue