mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Add more tests
This commit is contained in:
		
							parent
							
								
									4a26633e0e
								
							
						
					
					
						commit
						e751c86dcb
					
				
					 1 changed files with 12 additions and 1 deletions
				
			
		|  | @ -246,11 +246,22 @@ def QueueJoinTest(q): | |||
|         q.put(i) | ||||
|     q.join() | ||||
|     verify(cum==sum(range(100)), "q.join() did not block until all tasks were done") | ||||
|     q.join()        # Make sure you can join more than once | ||||
| 
 | ||||
| def QueueTaskDoneTest(q) | ||||
|     try: | ||||
|         q.task_done() | ||||
|     except ValueError: | ||||
|         pass | ||||
|     else: | ||||
|         raise TestFailed("Did not detect task count going negative") | ||||
| 
 | ||||
| def test(): | ||||
|     q = Queue.Queue() | ||||
|     q = Queue.Queue(20) | ||||
|     QueueTaskDoneTest(q) | ||||
|     QueueJoinTest(q) | ||||
|     QueueJoinTest(q) | ||||
|     QueueTaskDoneTest(q) | ||||
| 
 | ||||
|     q = Queue.Queue(QUEUE_SIZE) | ||||
|     # Do it a couple of times on the same queue | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Raymond Hettinger
						Raymond Hettinger