summaryrefslogtreecommitdiff
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index e76f0a0b2b..22e6c5152d 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1274,10 +1274,16 @@ class ProgramPriorityTests(unittest.TestCase):
"""Tests for os.getpriority() and os.setpriority()."""
def test_set_get_priority(self):
+
base = os.getpriority(os.PRIO_PROCESS, os.getpid())
os.setpriority(os.PRIO_PROCESS, os.getpid(), base + 1)
try:
- self.assertEqual(os.getpriority(os.PRIO_PROCESS, os.getpid()), base + 1)
+ new_prio = os.getpriority(os.PRIO_PROCESS, os.getpid())
+ if base >= 19 and new_prio <= 19:
+ raise unittest.SkipTest(
+ "unable to reliably test setpriority at current nice level of %s" % base)
+ else:
+ self.assertEqual(new_prio, base + 1)
finally:
try:
os.setpriority(os.PRIO_PROCESS, os.getpid(), base)