diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-08-02 22:41:34 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-08-02 22:41:34 (GMT) |
commit | 2740af8cc48b0f310557c0630d613301b7a5c2d4 (patch) | |
tree | e0e43ab66e547579f31fd01f221bf011eb909943 /Lib/test/test_posix.py | |
parent | 94b580d423524188bcf7136f9829fb68eb6d15d3 (diff) | |
download | cpython-2740af8cc48b0f310557c0630d613301b7a5c2d4.zip cpython-2740af8cc48b0f310557c0630d613301b7a5c2d4.tar.gz cpython-2740af8cc48b0f310557c0630d613301b7a5c2d4.tar.bz2 |
sched.h can exist without sched affinity support
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index b649cd9..1c2a4da 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -831,6 +831,8 @@ 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") @requires_sched_h def test_sched_yield(self): @@ -888,7 +890,7 @@ class PosixTester(unittest.TestCase): self.assertGreaterEqual(interval, 0.) self.assertLess(interval, 1.) - @requires_sched_h + @requires_sched_affinity def test_sched_affinity(self): mask = posix.sched_getaffinity(0, 1024) self.assertGreaterEqual(mask.count(), 1) @@ -899,7 +901,7 @@ class PosixTester(unittest.TestCase): self.assertRaises(OSError, posix.sched_setaffinity, 0, empty) self.assertRaises(OSError, posix.sched_setaffinity, -1, mask) - @requires_sched_h + @requires_sched_affinity def test_cpu_set_basic(self): s = posix.cpu_set(10) self.assertEqual(len(s), 10) @@ -924,7 +926,7 @@ class PosixTester(unittest.TestCase): self.assertRaises(ValueError, s.isset, -1) self.assertRaises(ValueError, s.isset, 10) - @requires_sched_h + @requires_sched_affinity def test_cpu_set_cmp(self): self.assertNotEqual(posix.cpu_set(11), posix.cpu_set(12)) l = posix.cpu_set(10) @@ -935,7 +937,7 @@ class PosixTester(unittest.TestCase): r.set(1) self.assertEqual(l, r) - @requires_sched_h + @requires_sched_affinity def test_cpu_set_bitwise(self): l = posix.cpu_set(5) l.set(0) |