[Python-checkins] gh-100005: Skip test_script_as_dev_fd() on FreeBSD (GH-100006)

miss-islington webhook-mailer at python.org
Mon Dec 5 09:07:54 EST 2022


https://github.com/python/cpython/commit/5533cf67e7cdd873136a963e30a437bfcbbdffdf
commit: 5533cf67e7cdd873136a963e30a437bfcbbdffdf
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-12-05T06:07:48-08:00
summary:

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 at python.org>

files:
M Lib/test/test_cmd_line_script.py
M Lib/test/test_subprocess.py

diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 0c40dae0f441..4dadbc0b64bd 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -741,6 +741,9 @@ def test_nonexisting_script(self):
         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
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 8713c73f87a0..abd0dd8b2569 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2832,7 +2832,7 @@ def test_close_fds(self):
 
     @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")



More information about the Python-checkins mailing list