Skip to content

Commit 038b151

Browse files
authored
gh-100005: Skip test_script_as_dev_fd() on FreeBSD (#100006)
On FreeBSD, skip test_script_as_dev_fd() of test_cmd_line_script if fdescfs is not mounted (at /dev/fd).
1 parent e3a3863 commit 038b151

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/test/test_cmd_line_script.py

+3
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,9 @@ def test_nonexisting_script(self):
753753
self.assertNotEqual(proc.returncode, 0)
754754

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

Lib/test/test_subprocess.py

+1-1
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)