summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-08-21 10:41:43 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-08-21 10:41:43 (GMT)
commit7b911cb62193a82b084926aec3b0bcaaaf1af865 (patch)
treedbb8109984e3fb39a39d1accbefa65051d336fe4 /Lib/test/test_posix.py
parent795eaeb41f358d3eb14731c04fb2bd9c1da83aa4 (diff)
downloadcpython-7b911cb62193a82b084926aec3b0bcaaaf1af865.zip
cpython-7b911cb62193a82b084926aec3b0bcaaaf1af865.tar.gz
cpython-7b911cb62193a82b084926aec3b0bcaaaf1af865.tar.bz2
Issue #12783: Fix test_posix failures on FreeBSD buildbots, due to
sched_setparam() returning EINVAL for processes with SCHED_OTHER scheduling policy.
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 6a3c33f..a098fc0 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -875,8 +875,14 @@ class PosixTester(unittest.TestCase):
except OSError as e:
if e.errno != errno.EPERM:
raise
- posix.sched_setparam(0, param)
- self.assertRaises(OSError, posix.sched_setparam, -1, param)
+
+ # POSIX states that calling sched_setparam() on a process with a
+ # scheduling policy other than SCHED_FIFO or SCHED_RR is
+ # implementation-defined: FreeBSD returns EINVAL.
+ if not sys.platform.startswith('freebsd'):
+ posix.sched_setparam(0, param)
+ self.assertRaises(OSError, posix.sched_setparam, -1, param)
+
self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param)
self.assertRaises(TypeError, posix.sched_setscheduler, 0, mine, None)
self.assertRaises(TypeError, posix.sched_setparam, 0, 43)