mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	gh-57684: Update tests for PYTHONSAFEPATH=1 (#92358)
Fix tests failing with the PYTHONSAFEPATH=1 env var. Enhance also -P help in Python usage (python --help).
This commit is contained in:
		
							parent
							
								
									1303f8c927
								
							
						
					
					
						commit
						329afe78c3
					
				
					 8 changed files with 33 additions and 15 deletions
				
			
		|  | @ -454,7 +454,9 @@ def testParseArgsSelectedTestNames(self): | |||
| 
 | ||||
|     def testSelectedTestNamesFunctionalTest(self): | ||||
|         def run_unittest(args): | ||||
|             p = subprocess.Popen([sys.executable, '-m', 'unittest'] + args, | ||||
|             # Use -E to ignore PYTHONSAFEPATH env var | ||||
|             cmd = [sys.executable, '-E', '-m', 'unittest'] + args | ||||
|             p = subprocess.Popen(cmd, | ||||
|                 stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, cwd=os.path.dirname(__file__)) | ||||
|             with p: | ||||
|                 _, stderr = p.communicate() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner