summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Certik <ondrej.certik@gmail.com>2013-03-10 15:21:45 +0100
committerOndrej Certik <ondrej.certik@gmail.com>2013-03-10 15:24:32 +0100
commit36c43214d25101c7acd63e0394877b5e04661639 (patch)
tree0c0d6c41393656138c314ab99447e2326ce5d48b
parent92770f4c6d6b74ee8788e621b67e757c1a21138e (diff)
downloadnumpy-36c43214d25101c7acd63e0394877b5e04661639.tar.gz
TST: Redirect the other stream to temp. file
Now things behave the same if executed with either of: nosetests nosetests -s
-rw-r--r--numpy/distutils/tests/test_exec_command.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/numpy/distutils/tests/test_exec_command.py b/numpy/distutils/tests/test_exec_command.py
index 69943f140..e9916039f 100644
--- a/numpy/distutils/tests/test_exec_command.py
+++ b/numpy/distutils/tests/test_exec_command.py
@@ -1,6 +1,7 @@
import os
import sys
import StringIO
+from tempfile import TemporaryFile
from numpy.distutils import exec_command
@@ -53,19 +54,23 @@ def test_exec_command_stdout():
# Test posix version:
with redirect_stdout(StringIO.StringIO()):
- exec_command.exec_command("cd '.'")
+ with redirect_stderr(TemporaryFile()):
+ exec_command.exec_command("cd '.'")
# Test non-posix version:
with emulate_nonposix():
with redirect_stdout(StringIO.StringIO()):
- exec_command.exec_command("cd '.'")
+ with redirect_stderr(TemporaryFile()):
+ exec_command.exec_command("cd '.'")
def test_exec_command_stderr():
# Test posix version:
- with redirect_stderr(StringIO.StringIO()):
- exec_command.exec_command("cd '.'")
+ with redirect_stdout(TemporaryFile()):
+ with redirect_stderr(StringIO.StringIO()):
+ exec_command.exec_command("cd '.'")
# Test non-posix version:
with emulate_nonposix():
- with redirect_stderr(StringIO.StringIO()):
- exec_command.exec_command("cd '.'")
+ with redirect_stdout(TemporaryFile()):
+ with redirect_stderr(StringIO.StringIO()):
+ exec_command.exec_command("cd '.'")