gh-71052: Add test exclusions to support running the test suite on Android (#115918)

This commit is contained in:
Malcolm Smith 2024-02-29 21:32:50 +00:00 committed by GitHub
parent 83c5ecdeec
commit 41d5391c55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 58 additions and 27 deletions

View file

@ -1270,9 +1270,10 @@ class PosixTester(unittest.TestCase):
self.assertIn(mine, possible_schedulers)
try:
parent = posix.sched_getscheduler(os.getppid())
except OSError as e:
if e.errno != errno.EPERM:
raise
except PermissionError:
# POSIX specifies EPERM, but Android returns EACCES. Both errno
# values are mapped to PermissionError.
pass
else:
self.assertIn(parent, possible_schedulers)
self.assertRaises(OSError, posix.sched_getscheduler, -1)
@ -1287,9 +1288,8 @@ class PosixTester(unittest.TestCase):
try:
posix.sched_setscheduler(0, mine, param)
posix.sched_setparam(0, param)
except OSError as e:
if e.errno != errno.EPERM:
raise
except PermissionError:
pass
self.assertRaises(OSError, posix.sched_setparam, -1, param)
self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param)