]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-100005: Skip test_script_as_dev_fd() on FreeBSD (#100006)
authorVictor Stinner <vstinner@python.org>
Mon, 5 Dec 2022 13:23:35 +0000 (14:23 +0100)
committerGitHub <noreply@github.com>
Mon, 5 Dec 2022 13:23:35 +0000 (14:23 +0100)
On FreeBSD, skip test_script_as_dev_fd() of test_cmd_line_script if
fdescfs is not mounted (at /dev/fd).

Lib/test/test_cmd_line_script.py
Lib/test/test_subprocess.py

index c838e95ad554e3106ec0cdddf21ff05eed29a47c..f10d72ea5547ee60252779ccb5a6d41a851c4e55 100644 (file)
@@ -753,6 +753,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 8713c73f87a0546e68e69ad4c167709b4336288d..abd0dd8b25699bb68be28a5897ea680e47770db6 100644 (file)
@@ -2832,7 +2832,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")