mirror of
https://github.com/python/cpython.git
synced 2025-09-01 14:38:00 +00:00
bpo-41625: Skip os.splice() tests on AIX (GH-23354)
On AIX, splice() only works with a socket, whereas the test uses a pipe.
This commit is contained in:
parent
29aa624047
commit
1de61d3923
1 changed files with 8 additions and 0 deletions
|
@ -93,6 +93,11 @@ def create_file(filename, content=b'content'):
|
||||||
fp.write(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):
|
class MiscTests(unittest.TestCase):
|
||||||
def test_getcwd(self):
|
def test_getcwd(self):
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
|
@ -387,6 +392,7 @@ class FileTests(unittest.TestCase):
|
||||||
os.splice(0, 1, -10)
|
os.splice(0, 1, -10)
|
||||||
|
|
||||||
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
|
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
|
||||||
|
@requires_splice_pipe
|
||||||
def test_splice(self):
|
def test_splice(self):
|
||||||
TESTFN2 = os_helper.TESTFN + ".3"
|
TESTFN2 = os_helper.TESTFN + ".3"
|
||||||
data = b'0123456789'
|
data = b'0123456789'
|
||||||
|
@ -419,6 +425,7 @@ class FileTests(unittest.TestCase):
|
||||||
self.assertEqual(os.read(read_fd, 100), data[:i])
|
self.assertEqual(os.read(read_fd, 100), data[:i])
|
||||||
|
|
||||||
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
|
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
|
||||||
|
@requires_splice_pipe
|
||||||
def test_splice_offset_in(self):
|
def test_splice_offset_in(self):
|
||||||
TESTFN4 = os_helper.TESTFN + ".4"
|
TESTFN4 = os_helper.TESTFN + ".4"
|
||||||
data = b'0123456789'
|
data = b'0123456789'
|
||||||
|
@ -456,6 +463,7 @@ class FileTests(unittest.TestCase):
|
||||||
self.assertEqual(read, data[in_skip:in_skip+i])
|
self.assertEqual(read, data[in_skip:in_skip+i])
|
||||||
|
|
||||||
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
|
@unittest.skipUnless(hasattr(os, 'splice'), 'test needs os.splice()')
|
||||||
|
@requires_splice_pipe
|
||||||
def test_splice_offset_out(self):
|
def test_splice_offset_out(self):
|
||||||
TESTFN4 = os_helper.TESTFN + ".4"
|
TESTFN4 = os_helper.TESTFN + ".4"
|
||||||
data = b'0123456789'
|
data = b'0123456789'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue