From: Martin Panter Date: Fri, 11 Dec 2015 05:40:14 +0000 (+0000) Subject: Issue #25764: Skip fork failure test when run as root X-Git-Tag: v3.6.0a1~928^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5cf791b0357f7def78dd8190b3544ac4d44d28f9;p=thirdparty%2FPython%2Fcpython.git Issue #25764: Skip fork failure test when run as root --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index b32ef9788cef..6628512893ff 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1525,10 +1525,14 @@ class POSIXProcessTestCase(BaseTestCase): [_, 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