]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-32285)
authorChristian Heimes <christian@python.org>
Sun, 3 Apr 2022 15:03:49 +0000 (18:03 +0300)
committerGitHub <noreply@github.com>
Sun, 3 Apr 2022 15:03:49 +0000 (17:03 +0200)
Lib/test/test_posix.py
Misc/NEWS.d/next/Tests/2022-04-03-14-38-21.bpo-47205.hbbTnh.rst [new file with mode: 0644]

index c10039b17f7f8d3b15b963fcdf8f3f9c3bcb7571..f44b8d0403ff2555f0f297d342ecb700124f5442 100644 (file)
@@ -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
diff --git a/Misc/NEWS.d/next/Tests/2022-04-03-14-38-21.bpo-47205.hbbTnh.rst b/Misc/NEWS.d/next/Tests/2022-04-03-14-38-21.bpo-47205.hbbTnh.rst
new file mode 100644 (file)
index 0000000..35fd944
--- /dev/null
@@ -0,0 +1,2 @@
+Skip test for :func:`~os.sched_getaffinity` and
+:func:`~os.sched_setaffinity` error case on FreeBSD.