summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-04-03 15:03:49 (GMT)
committerGitHub <noreply@github.com>2022-04-03 15:03:49 (GMT)
commitb82cdd1dac9a9be52051abd90a1ce69236ac41f4 (patch)
treeeba082c36cbf02e0feee823ad0528e3599622f0a /Lib/test/test_posix.py
parent3faa9f78d4b9a8c0fd4657b434bdb08ae1f28800 (diff)
downloadcpython-b82cdd1dac9a9be52051abd90a1ce69236ac41f4.zip
cpython-b82cdd1dac9a9be52051abd90a1ce69236ac41f4.tar.gz
cpython-b82cdd1dac9a9be52051abd90a1ce69236ac41f4.tar.bz2
bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-32285)
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index c10039b..f44b8d0 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -1194,7 +1194,9 @@ class PosixTester(unittest.TestCase):
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)
@@ -1212,7 +1214,9 @@ class PosixTester(unittest.TestCase):
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