mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Issue #15338: skip test_UNC_path when the current user doesn't have enough permissions to access the path.
This commit is contained in:
		
							parent
							
								
									52cc722ab8
								
							
						
					
					
						commit
						68f4247b65
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -461,6 +461,13 @@ def _test_UNC_path(self):
 | 
				
			||||||
        drive = path[0]
 | 
					        drive = path[0]
 | 
				
			||||||
        unc = "\\\\%s\\%s$"%(hn, drive)
 | 
					        unc = "\\\\%s\\%s$"%(hn, drive)
 | 
				
			||||||
        unc += path[2:]
 | 
					        unc += path[2:]
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            os.listdir(unc)
 | 
				
			||||||
 | 
					        except OSError as e:
 | 
				
			||||||
 | 
					            if e.errno in (errno.EPERM, errno.EACCES):
 | 
				
			||||||
 | 
					                # See issue #15338
 | 
				
			||||||
 | 
					                self.skipTest("cannot access administrative share %r" % (unc,))
 | 
				
			||||||
 | 
					            raise
 | 
				
			||||||
        sys.path.append(path)
 | 
					        sys.path.append(path)
 | 
				
			||||||
        mod = __import__("test_trailing_slash")
 | 
					        mod = __import__("test_trailing_slash")
 | 
				
			||||||
        self.assertEqual(mod.testdata, 'test_trailing_slash')
 | 
					        self.assertEqual(mod.testdata, 'test_trailing_slash')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue