Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-41625: Skip os.splice() tests on AIX #23354

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down