summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-02-21 21:02:04 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-02-21 21:02:04 (GMT)
commit0607f731f26de1ae4fba3c880e5286f5418a5227 (patch)
tree115a209d87618f503614e36c67d2af22967463e7 /Lib
parent66471134190c4f33fbaa97b736078fe761be5635 (diff)
downloadcpython-0607f731f26de1ae4fba3c880e5286f5418a5227.zip
cpython-0607f731f26de1ae4fba3c880e5286f5418a5227.tar.gz
cpython-0607f731f26de1ae4fba3c880e5286f5418a5227.tar.bz2
Fix flaky os.urandom test.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_os.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 1268fa3..4898e4e 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