bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-32285)

(cherry picked from commit b82cdd1dac)

Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
Miss Islington (bot) 2022-04-03 12:27:32 -07:00 committed by GitHub
parent a5c90784be
commit 470dfe20cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -1179,7 +1179,9 @@ def test_sched_getaffinity(self):
mask = posix.sched_getaffinity(0)
self.assertIsInstance(mask, set)
self.assertGreaterEqual(len(mask), 1)
self.assertRaises(OSError, posix.sched_getaffinity, -1)
if not sys.platform.startswith("freebsd"):
# bpo-47205: does not raise OSError on FreeBSD
self.assertRaises(OSError, posix.sched_getaffinity, -1)
for cpu in mask:
self.assertIsInstance(cpu, int)
self.assertGreaterEqual(cpu, 0)
@ -1197,7 +1199,9 @@ def test_sched_setaffinity(self):
self.assertRaises(ValueError, posix.sched_setaffinity, 0, [-10])
self.assertRaises(ValueError, posix.sched_setaffinity, 0, map(int, "0X"))
self.assertRaises(OverflowError, posix.sched_setaffinity, 0, [1<<128])
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
if not sys.platform.startswith("freebsd"):
# bpo-47205: does not raise OSError on FreeBSD
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
def test_rtld_constants(self):
# check presence of major RTLD_* constants