From 0607f731f26de1ae4fba3c880e5286f5418a5227 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 21 Feb 2012 22:02:04 +0100 Subject: [PATCH] Fix flaky os.urandom test. --- Lib/test/test_os.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 1268fa3622..4898e4ea09 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -545,12 +545,13 @@ class URandomTests (unittest.TestCase): 'import os, sys', 'data = os.urandom(%s)' % count, 'sys.stdout.write(data)', - 'sys.stdout.flush()')) + 'sys.stdout.flush()', + 'print >> sys.stderr, (len(data), data)')) cmd_line = [sys.executable, '-c', code] p = subprocess.Popen(cmd_line, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() - out = test_support.strip_python_stderr(out) + self.assertEqual(p.wait(), 0, (p.wait(), err)) self.assertEqual(len(out), count) return out -- 2.40.0