summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-04-13 16:06:03 (GMT)
committerGitHub <noreply@github.com>2019-04-13 16:06:03 (GMT)
commit46544f69bff1c3c4173d461be35993ca0109f622 (patch)
tree24b404ba17471039051090ef1b7cf5347571db3e /Lib
parentf2cf1e3e2892a6326949c2570f1bb6d6c95715fb (diff)
downloadcpython-46544f69bff1c3c4173d461be35993ca0109f622.zip
cpython-46544f69bff1c3c4173d461be35993ca0109f622.tar.gz
cpython-46544f69bff1c3c4173d461be35993ca0109f622.tar.bz2
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_posix.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index fe21b21..8434029 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -310,6 +310,14 @@ class PosixTester(unittest.TestCase):
buf = [bytearray(i) for i in [5, 3, 2]]
self.assertEqual(posix.preadv(fd, buf, 3, os.RWF_HIPRI), 10)
self.assertEqual([b't1tt2', b't3t', b'5t'], list(buf))
+ except OSError as inst:
+ # Is possible that the macro RWF_HIPRI was defined at compilation time
+ # but the option is not supported by the kernel or the runtime libc shared
+ # library.
+ if inst.errno in {errno.EINVAL, errno.ENOTSUP}:
+ raise unittest.SkipTest("RWF_HIPRI is not supported by the current system")
+ else:
+ raise
finally:
os.close(fd)