changeset: 99523:fe844253cd44 branch: 3.5 user: Martin Panter date: Fri Dec 11 05:40:14 2015 +0000 files: Lib/test/test_subprocess.py description: Issue #25764: Skip fork failure test when run as root diff -r 03c4ca1a34e2 -r fe844253cd44 Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Fri Dec 11 05:19:29 2015 +0000 +++ b/Lib/test/test_subprocess.py Fri Dec 11 05:40:14 2015 +0000 @@ -1525,10 +1525,14 @@ [_, hard] = limits setrlimit(RLIMIT_NPROC, (0, hard)) self.addCleanup(setrlimit, RLIMIT_NPROC, limits) - # Forking should raise EAGAIN, translated to BlockingIOError - with self.assertRaises(BlockingIOError): + try: subprocess.call([sys.executable, '-c', ''], preexec_fn=lambda: None) + except BlockingIOError: + # Forking should raise EAGAIN, translated to BlockingIOError + pass + else: + self.skipTest('RLIMIT_NPROC had no effect; probably superuser') def test_args_string(self): # args is a string