[3.9] bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-32285) by miss-islington · Pull Request #32287 · python/cpython
Expand Up
@@ -1153,7 +1153,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)
Expand All
@@ -1171,7 +1173,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 Expand Down
def test_rtld_constants(self): # check presence of major RTLD_* constants Expand Down