[Python-checkins] bpo-41625: Skip os.splice() tests on AIX (GH-23354)
vstinner
webhook-mailer at python.org
Tue Nov 17 17:08:19 EST 2020
https://github.com/python/cpython/commit/1de61d3923840b29e847d311f0c7d4c5821d98e6
commit: 1de61d3923840b29e847d311f0c7d4c5821d98e6
branch: master
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2020年11月17日T23:08:10+01:00
summary:
bpo-41625: Skip os.splice() tests on AIX (GH-23354)
On AIX, splice() only works with a socket, whereas the test uses a
pipe.
files:
M Lib/test/test_os.py
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index d6da4617d50f7..f127cb199bbb5 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -93,6 +93,11 @@ def create_file(filename, content=b'content'):
fp.write(content)
+# bpo-41625: On AIX, splice() only works with a socket, not with a pipe.
+requires_splice_pipe = unittest.skipIf(sys.platform.startswith("aix"),
+ 'on AIX, splice() only accepts sockets')
+
+
class MiscTests(unittest.TestCase):
def test_getcwd(self):
cwd = os.getcwd()
@@ -387,6 +392,7 @@ def test_splice_invalid_values(self):
os.splice(0, 1, -10)
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
+ @requires_splice_pipe
def test_splice(self):
TESTFN2 = os_helper.TESTFN + ".3"
data = b'0123456789'
@@ -419,6 +425,7 @@ def test_splice(self):
self.assertEqual(os.read(read_fd, 100), data[:i])
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
+ @requires_splice_pipe
def test_splice_offset_in(self):
TESTFN4 = os_helper.TESTFN + ".4"
data = b'0123456789'
@@ -456,6 +463,7 @@ def test_splice_offset_in(self):
self.assertEqual(read, data[in_skip:in_skip+i])
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
+ @requires_splice_pipe
def test_splice_offset_out(self):
TESTFN4 = os_helper.TESTFN + ".4"
data = b'0123456789'
More information about the Python-checkins
mailing list