]> granicus.if.org Git - python/commitdiff
Issue #16170: Remove Linux skip from test_subprocess's test_executable test.
authorChris Jerdonek <chris.jerdonek@gmail.com>
Tue, 9 Oct 2012 20:17:49 +0000 (13:17 -0700)
committerChris Jerdonek <chris.jerdonek@gmail.com>
Tue, 9 Oct 2012 20:17:49 +0000 (13:17 -0700)
Lib/test/test_subprocess.py

index 07e2b4b688d1625f3c7b131e1cc79ff98c92ae42..8f5a58c68b93e47fb714df708f0cbe348a3ebd97 100644 (file)
@@ -200,13 +200,16 @@ class ProcessTestCase(BaseTestCase):
         p.wait()
         self.assertEqual(47, p.returncode)
 
-    # TODO: make this test work on Linux.
-    # This may be failing on Linux because of issue #7774.
-    @unittest.skipIf(sys.platform not in ('win32', 'darwin'),
-                     "possible bug using executable argument on Linux")
     def test_executable(self):
         # Check that the executable argument works.
-        self._assert_python(["doesnotexist", "-c"], executable=sys.executable)
+        #
+        # On Unix (non-Mac and non-Windows), Python looks at args[0] to
+        # determine where its standard library is, so we need the directory
+        # of args[0] to be valid for the Popen() call to Python to succeed.
+        # See also issue #16170 and issue #7774.
+        doesnotexist = os.path.join(os.path.dirname(sys.executable),
+                                    "doesnotexist")
+        self._assert_python([doesnotexist, "-c"], executable=sys.executable)
 
     def test_executable_takes_precedence(self):
         # Check that the executable argument takes precedence over args[0].