[Python-checkins] r81019 - python/branches/py3k/Lib/test/test_os.py

gregory.p.smith python-checkins at python.org
Sun May 9 05:36:42 CEST 2010


Author: gregory.p.smith
Date: Sun May  9 05:36:42 2010
New Revision: 81019

Log:
Replace /s with os.sep in the new internal_execvpe test.  Hopefully fixes
this test on windows.


Modified:
   python/branches/py3k/Lib/test/test_os.py

Modified: python/branches/py3k/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k/Lib/test/test_os.py	(original)
+++ python/branches/py3k/Lib/test/test_os.py	Sun May  9 05:36:42 2010
@@ -653,7 +653,7 @@
             raise OSError(errno.ENOTDIR, "execve called")
 
         def _mock_get_exec_path(self, env=None):
-            return ['/p', '/pp']
+            return [os.sep+'p', os.sep+'pp']
 
         def __enter__(self):
             self.orig_execv = os.execv
@@ -673,13 +673,16 @@
     def test_internal_execvpe(self):
         exec_stubbed = self._stub_out_for_execvpe_test()
         with exec_stubbed:
-            self.assertRaises(RuntimeError, os._execvpe, '/f', ['-a'])
-            self.assertEqual([('execv', '/f', (['-a'],))], exec_stubbed.calls)
+            self.assertRaises(RuntimeError, os._execvpe, os.sep+'f', ['-a'])
+            self.assertEqual([('execv', os.sep+'f', (['-a'],))],
+                             exec_stubbed.calls)
             exec_stubbed.calls = []
             self.assertRaises(OSError, os._execvpe, 'f', ['-a'],
                               env={'spam': 'beans'})
-            self.assertEqual([('execve', '/p/f', (['-a'], {'spam': 'beans'})),
-                              ('execve', '/pp/f', (['-a'], {'spam': 'beans'}))],
+            self.assertEqual([('execve', os.sep+'p'+os.sep+'f',
+                               (['-a'], {'spam': 'beans'})),
+                              ('execve', os.sep+'pp'+os.sep+'f',
+                               (['-a'], {'spam': 'beans'}))],
                              exec_stubbed.calls)
 
 class Win32ErrorTests(unittest.TestCase):


More information about the Python-checkins mailing list