mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Replace /s with os.sep in the new internal_execvpe test. Hopefully fixes
this test on windows.
This commit is contained in:
		
							parent
							
								
									31191a9cc5
								
							
						
					
					
						commit
						3ea0062e0b
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
					@ -653,7 +653,7 @@ class ExecTests(unittest.TestCase):
 | 
				
			||||||
            raise OSError(errno.ENOTDIR, "execve called")
 | 
					            raise OSError(errno.ENOTDIR, "execve called")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def _mock_get_exec_path(self, env=None):
 | 
					        def _mock_get_exec_path(self, env=None):
 | 
				
			||||||
            return ['/p', '/pp']
 | 
					            return [os.sep+'p', os.sep+'pp']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def __enter__(self):
 | 
					        def __enter__(self):
 | 
				
			||||||
            self.orig_execv = os.execv
 | 
					            self.orig_execv = os.execv
 | 
				
			||||||
| 
						 | 
					@ -673,13 +673,16 @@ class ExecTests(unittest.TestCase):
 | 
				
			||||||
    def test_internal_execvpe(self):
 | 
					    def test_internal_execvpe(self):
 | 
				
			||||||
        exec_stubbed = self._stub_out_for_execvpe_test()
 | 
					        exec_stubbed = self._stub_out_for_execvpe_test()
 | 
				
			||||||
        with exec_stubbed:
 | 
					        with exec_stubbed:
 | 
				
			||||||
            self.assertRaises(RuntimeError, os._execvpe, '/f', ['-a'])
 | 
					            self.assertRaises(RuntimeError, os._execvpe, os.sep+'f', ['-a'])
 | 
				
			||||||
            self.assertEqual([('execv', '/f', (['-a'],))], exec_stubbed.calls)
 | 
					            self.assertEqual([('execv', os.sep+'f', (['-a'],))],
 | 
				
			||||||
 | 
					                             exec_stubbed.calls)
 | 
				
			||||||
            exec_stubbed.calls = []
 | 
					            exec_stubbed.calls = []
 | 
				
			||||||
            self.assertRaises(OSError, os._execvpe, 'f', ['-a'],
 | 
					            self.assertRaises(OSError, os._execvpe, 'f', ['-a'],
 | 
				
			||||||
                              env={'spam': 'beans'})
 | 
					                              env={'spam': 'beans'})
 | 
				
			||||||
            self.assertEqual([('execve', '/p/f', (['-a'], {'spam': 'beans'})),
 | 
					            self.assertEqual([('execve', os.sep+'p'+os.sep+'f',
 | 
				
			||||||
                              ('execve', '/pp/f', (['-a'], {'spam': 'beans'}))],
 | 
					                               (['-a'], {'spam': 'beans'})),
 | 
				
			||||||
 | 
					                              ('execve', os.sep+'pp'+os.sep+'f',
 | 
				
			||||||
 | 
					                               (['-a'], {'spam': 'beans'}))],
 | 
				
			||||||
                             exec_stubbed.calls)
 | 
					                             exec_stubbed.calls)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Win32ErrorTests(unittest.TestCase):
 | 
					class Win32ErrorTests(unittest.TestCase):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue