mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #20056: Fixed deprecation warning about bytes path in test_shutil on
Windows. Path by Vajrasky Kok.
This commit is contained in:
		
							parent
							
								
									22f2d2efb7
								
							
						
					
					
						commit
						41ad77c697
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -10,6 +10,7 @@ | |||
| import errno | ||||
| import functools | ||||
| import subprocess | ||||
| from contextlib import ExitStack | ||||
| from test import support | ||||
| from test.support import TESTFN | ||||
| from os.path import splitdrive | ||||
|  | @ -116,7 +117,9 @@ def test_rmtree_works_on_bytes(self): | |||
|         write_file(os.path.join(victim, 'somefile'), 'foo') | ||||
|         victim = os.fsencode(victim) | ||||
|         self.assertIsInstance(victim, bytes) | ||||
|         shutil.rmtree(victim) | ||||
|         win = (os.name == 'nt') | ||||
|         with self.assertWarns(DeprecationWarning) if win else ExitStack(): | ||||
|             shutil.rmtree(victim) | ||||
| 
 | ||||
|     @support.skip_unless_symlink | ||||
|     def test_rmtree_fails_on_symlink(self): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka