[Python-checkins] Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
Miss Islington (bot)
webhook-mailer at python.org
Sat Apr 13 12:25:23 EDT 2019
https://github.com/python/cpython/commit/d28aaa7df8bcd46f4135d240d041b0b171b664cc
commit: d28aaa7df8bcd46f4135d240d041b0b171b664cc
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-04-13T09:25:20-07:00
summary:
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
(cherry picked from commit 46544f69bff1c3c4173d461be35993ca0109f622)
Co-authored-by: Pablo Galindo <Pablogsal at gmail.com>
files:
M Lib/test/test_posix.py
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 11180b7278c9..55077354589d 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -308,6 +308,14 @@ def test_preadv_flags(self):
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)
More information about the Python-checkins
mailing list