mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	[3.13] gh-135386: Skip readonly tests for the root user (GH-138058) (GH-138064)
(cherry picked from commit 5b0f00e616)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									ebccd1de88
								
							
						
					
					
						commit
						ab8ffc482e
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -17,6 +17,11 @@ | |||
| from dbm.sqlite3 import _normalize_uri | ||||
| 
 | ||||
| 
 | ||||
| root_in_posix = False | ||||
| if hasattr(os, 'geteuid'): | ||||
|     root_in_posix = (os.geteuid() == 0) | ||||
| 
 | ||||
| 
 | ||||
| class _SQLiteDbmTests(unittest.TestCase): | ||||
| 
 | ||||
|     def setUp(self): | ||||
|  | @ -93,6 +98,7 @@ def test_readonly_iter(self): | |||
|         self.assertEqual([k for k in self.db], [b"key1", b"key2"]) | ||||
| 
 | ||||
| 
 | ||||
| @unittest.skipIf(root_in_posix, "test is meanless with root privilege") | ||||
| class ReadOnlyFilesystem(unittest.TestCase): | ||||
| 
 | ||||
|     def setUp(self): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miss Islington (bot)
						Miss Islington (bot)