mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Merged revisions 75851 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75851 | antoine.pitrou | 2009-10-27 21:02:23 +0100 (mar., 27 oct. 2009) | 3 lines Suppress transient refleaks in test_threading. ........
This commit is contained in:
		
							parent
							
								
									c3d47724c1
								
							
						
					
					
						commit
						b0e9bd4741
					
				
					 1 changed files with 12 additions and 3 deletions
				
			
		|  | @ -56,7 +56,16 @@ def run(self): | ||||||
|                           (self.name, self.nrunning.get())) |                           (self.name, self.nrunning.get())) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class ThreadTests(unittest.TestCase): | class BaseTestCase(unittest.TestCase): | ||||||
|  |     def setUp(self): | ||||||
|  |         self._threads = test.support.threading_setup() | ||||||
|  | 
 | ||||||
|  |     def tearDown(self): | ||||||
|  |         test.support.threading_cleanup(*self._threads) | ||||||
|  |         test.support.reap_children() | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class ThreadTests(BaseTestCase): | ||||||
| 
 | 
 | ||||||
|     # Create a bunch of threads, let each do some work, wait until all are |     # Create a bunch of threads, let each do some work, wait until all are | ||||||
|     # done. |     # done. | ||||||
|  | @ -389,7 +398,7 @@ def test_old_threading_api(self): | ||||||
|         threading.activeCount() |         threading.activeCount() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class ThreadJoinOnShutdown(unittest.TestCase): | class ThreadJoinOnShutdown(BaseTestCase): | ||||||
| 
 | 
 | ||||||
|     def _run_and_join(self, script): |     def _run_and_join(self, script): | ||||||
|         script = """if 1: |         script = """if 1: | ||||||
|  | @ -470,7 +479,7 @@ def worker(): | ||||||
|         self._run_and_join(script) |         self._run_and_join(script) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class ThreadingExceptionTests(unittest.TestCase): | class ThreadingExceptionTests(BaseTestCase): | ||||||
|     # A RuntimeError should be raised if Thread.start() is called |     # A RuntimeError should be raised if Thread.start() is called | ||||||
|     # multiple times. |     # multiple times. | ||||||
|     def test_start_thread_again(self): |     def test_start_thread_again(self): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Antoine Pitrou
						Antoine Pitrou