diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2018-09-14 22:12:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 22:12:22 (GMT) |
commit | 3d18b50a12e639e018d49d7b85663164d60bfd2b (patch) | |
tree | 16d9af1b98f877e5d9be6e6c0d5e834e711d01aa | |
parent | 7372c3bbefb4763dbd1b6d66f7971bef28c0f056 (diff) | |
download | cpython-3d18b50a12e639e018d49d7b85663164d60bfd2b.zip cpython-3d18b50a12e639e018d49d7b85663164d60bfd2b.tar.gz cpython-3d18b50a12e639e018d49d7b85663164d60bfd2b.tar.bz2 |
bpo-34685: Skip posix_spawn scheduler tests on BSD (GH-9316)
* Skip posix_spawn scheduler tests on BSD. We were already skyping similar tests as the behaviour can depend on the implementation in some cases.
-rw-r--r-- | Lib/test/test_posix.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index d402d4f..86c04b9 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -1659,15 +1659,17 @@ class TestPosixSpawn(unittest.TestCase): os.environ, setsigdef=[signal.NSIG, signal.NSIG+1]) @requires_sched + @unittest.skipIf(sys.platform.startswith(('freebsd', 'netbsd')), + "bpo-34685: test can fail on BSD") def test_setscheduler_only_param(self): policy = os.sched_getscheduler(0) priority = os.sched_get_priority_min(policy) code = textwrap.dedent(f"""\ - import os + import os, sys if os.sched_getscheduler(0) != {policy}: - os.exit(101) + sys.exit(101) if os.sched_getparam(0).sched_priority != {priority}: - os.exit(102)""") + sys.exit(102)""") pid = posix.posix_spawn( sys.executable, [sys.executable, '-c', code], @@ -1677,15 +1679,17 @@ class TestPosixSpawn(unittest.TestCase): self.assertEqual(os.waitpid(pid, 0), (pid, 0)) @requires_sched + @unittest.skipIf(sys.platform.startswith(('freebsd', 'netbsd')), + "bpo-34685: test can fail on BSD") def test_setscheduler_with_policy(self): policy = os.sched_getscheduler(0) priority = os.sched_get_priority_min(policy) code = textwrap.dedent(f"""\ - import os + import os, sys if os.sched_getscheduler(0) != {policy}: - os.exit(101) + sys.exit(101) if os.sched_getparam(0).sched_priority != {priority}: - os.exit(102)""") + sys.exit(102)""") pid = posix.posix_spawn( sys.executable, [sys.executable, '-c', code], |