summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-08-03 10:45:02 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2011-08-03 10:45:02 (GMT)
commit8283a622fc60ab0d30b6dd920bd3e5776845f30a (patch)
tree60f1c466a9054bf19180335d434a0233bb0b6ebc /Lib/test/test_posix.py
parent8a984b58b720a84eb743737b4b7bd3ee13e3ceb7 (diff)
parent83fad3e2cedeffb63544bc9357236f7ae9541024 (diff)
downloadcpython-8283a622fc60ab0d30b6dd920bd3e5776845f30a.zip
cpython-8283a622fc60ab0d30b6dd920bd3e5776845f30a.tar.gz
cpython-8283a622fc60ab0d30b6dd920bd3e5776845f30a.tar.bz2
merge heads
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 3fe791b..af64a6f 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -832,7 +832,7 @@ class PosixTester(unittest.TestCase):
requires_sched_h = unittest.skipUnless(hasattr(posix, 'sched_yield'),
"don't have scheduling support")
requires_sched_affinity = unittest.skipUnless(hasattr(posix, 'cpu_set'),
- "dont' have sched affinity support")
+ "don't have sched affinity support")
@requires_sched_h
def test_sched_yield(self):
@@ -848,8 +848,10 @@ class PosixTester(unittest.TestCase):
self.assertIsInstance(lo, int)
self.assertIsInstance(hi, int)
self.assertGreaterEqual(hi, lo)
- self.assertRaises(OSError, posix.sched_get_priority_min, -23)
- self.assertRaises(OSError, posix.sched_get_priority_max, -23)
+ # OSX evidently just returns 15 without checking the argument.
+ if sys.platform != "darwin":
+ self.assertRaises(OSError, posix.sched_get_priority_min, -23)
+ self.assertRaises(OSError, posix.sched_get_priority_max, -23)
@unittest.skipUnless(hasattr(posix, 'sched_setscheduler'), "can't change scheduler")
def test_get_and_set_scheduler_and_param(self):
@@ -888,7 +890,14 @@ class PosixTester(unittest.TestCase):
@unittest.skipUnless(hasattr(posix, "sched_rr_get_interval"), "no function")
def test_sched_rr_get_interval(self):
- interval = posix.sched_rr_get_interval(0)
+ try:
+ interval = posix.sched_rr_get_interval(0)
+ except OSError as e:
+ # This likely means that sched_rr_get_interval is only valid for
+ # processes with the SCHED_RR scheduler in effect.
+ if e.errno != errno.EINVAL:
+ raise
+ self.skipTest("only works on SCHED_RR processes")
self.assertIsInstance(interval, float)
# Reasonable constraints, I think.
self.assertGreaterEqual(interval, 0.)