Skip to content

Commit 5533cf6

Browse files
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 038b151) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 374b0a2 commit 5533cf6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/test/test_cmd_line_script.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,9 @@ def test_nonexisting_script(self):
741741
self.assertNotEqual(proc.returncode, 0)
742742

743743
@unittest.skipUnless(os.path.exists('/dev/fd/0'), 'requires /dev/fd platform')
744+
@unittest.skipIf(sys.platform.startswith("freebsd") and
745+
os.stat("/dev").st_dev == os.stat("/dev/fd").st_dev,
746+
"Requires fdescfs mounted on /dev/fd on FreeBSD")
744747
def test_script_as_dev_fd(self):
745748
# GH-87235: On macOS passing a non-trivial script to /dev/fd/N can cause
746749
# problems because all open /dev/fd/N file descriptors share the same

Lib/test/test_subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2832,7 +2832,7 @@ def test_close_fds(self):
28322832

28332833
@unittest.skipIf(sys.platform.startswith("freebsd") and
28342834
os.stat("/dev").st_dev == os.stat("/dev/fd").st_dev,
2835-
"Requires fdescfs mounted on /dev/fd on FreeBSD.")
2835+
"Requires fdescfs mounted on /dev/fd on FreeBSD")
28362836
def test_close_fds_when_max_fd_is_lowered(self):
28372837
"""Confirm that issue21618 is fixed (may fail under valgrind)."""
28382838
fd_status = support.findfile("fd_status.py", subdir="subprocessdata")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy