mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Make uuid1 and uuid4 tests conditional on whether ctypes can be imported;
implementation of either function depends on ctypes but uuid as a whole does not.
This commit is contained in:
		
							parent
							
								
									161586c804
								
							
						
					
					
						commit
						68a6da99e6
					
				
					 1 changed files with 12 additions and 0 deletions
				
			
		|  | @ -367,6 +367,12 @@ def test_getnode(self): | |||
|         self.assertEqual(node1, node2) | ||||
| 
 | ||||
|     def test_uuid1(self): | ||||
|         # uuid1 requires ctypes. | ||||
|         try: | ||||
|             import ctypes | ||||
|         except ImportError: | ||||
|             return | ||||
| 
 | ||||
|         equal = self.assertEqual | ||||
| 
 | ||||
|         # Make sure uuid1() generates UUIDs that are actually version 1. | ||||
|  | @ -420,6 +426,12 @@ def test_uuid3(self): | |||
|             equal(str(u), v) | ||||
| 
 | ||||
|     def test_uuid4(self): | ||||
|         # uuid4 requires ctypes. | ||||
|         try: | ||||
|             import ctypes | ||||
|         except ImportError: | ||||
|             return | ||||
| 
 | ||||
|         equal = self.assertEqual | ||||
| 
 | ||||
|         # Make sure uuid4() generates UUIDs that are actually version 4. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brett Cannon
						Brett Cannon