]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-100005: Skip test_script_as_dev_fd() on FreeBSD (GH-100006) (#125109)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 22 Oct 2024 11:11:04 +0000 (13:11 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Oct 2024 11:11:04 +0000 (12:11 +0100)
gh-100005: Skip test_script_as_dev_fd() on FreeBSD (GH-100006)

On FreeBSD, skip test_script_as_dev_fd() of test_cmd_line_script if
fdescfs is not mounted (at /dev/fd).
(cherry picked from commit 038b151963d9d4a5f4c852544fb5b0402ffcb218)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Lib/test/test_cmd_line_script.py
Lib/test/test_subprocess.py

index ccacfd606d186fc179ef931ea37e1e4e0c28e1a0..86bcafcf0e3cb3b867dc75fccb0c141aa52c81fd 100644 (file)
@@ -739,6 +739,9 @@ class CmdLineTest(unittest.TestCase):
         self.assertNotEqual(proc.returncode, 0)
 
     @unittest.skipUnless(os.path.exists('/dev/fd/0'), 'requires /dev/fd platform')
+    @unittest.skipIf(sys.platform.startswith("freebsd") and
+                     os.stat("/dev").st_dev == os.stat("/dev/fd").st_dev,
+                     "Requires fdescfs mounted on /dev/fd on FreeBSD")
     def test_script_as_dev_fd(self):
         # GH-87235: On macOS passing a non-trivial script to /dev/fd/N can cause
         # problems because all open /dev/fd/N file descriptors share the same
index 139ef41e57370bef5059a04ea949acf40c8443c8..0d3afe612a3afececee04596d68c3693e21ea711 100644 (file)
@@ -2795,7 +2795,7 @@ class POSIXProcessTestCase(BaseTestCase):
 
     @unittest.skipIf(sys.platform.startswith("freebsd") and
                      os.stat("/dev").st_dev == os.stat("/dev/fd").st_dev,
-                     "Requires fdescfs mounted on /dev/fd on FreeBSD.")
+                     "Requires fdescfs mounted on /dev/fd on FreeBSD")
     def test_close_fds_when_max_fd_is_lowered(self):
         """Confirm that issue21618 is fixed (may fail under valgrind)."""
         fd_status = support.findfile("fd_status.py", subdir="subprocessdata")