summaryrefslogtreecommitdiff
path: root/numpy/distutils/tests/test_exec_command.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils/tests/test_exec_command.py')
-rw-r--r--numpy/distutils/tests/test_exec_command.py31
1 files changed, 18 insertions, 13 deletions
diff --git a/numpy/distutils/tests/test_exec_command.py b/numpy/distutils/tests/test_exec_command.py
index 8bd265007..37912f5ba 100644
--- a/numpy/distutils/tests/test_exec_command.py
+++ b/numpy/distutils/tests/test_exec_command.py
@@ -6,7 +6,7 @@ from tempfile import TemporaryFile
from numpy.distutils import exec_command
from numpy.distutils.exec_command import get_pythonexe
-from numpy.testing import tempdir, assert_
+from numpy.testing import tempdir, assert_, assert_warns
# In python 3 stdout, stderr are text (unicode compliant) devices, so to
# emulate them import StringIO from the io module.
@@ -71,27 +71,31 @@ def test_exec_command_stdout():
# Test posix version:
with redirect_stdout(StringIO()):
with redirect_stderr(TemporaryFile()):
- exec_command.exec_command("cd '.'")
+ with assert_warns(DeprecationWarning):
+ exec_command.exec_command("cd '.'")
if os.name == 'posix':
# Test general (non-posix) version:
with emulate_nonposix():
with redirect_stdout(StringIO()):
with redirect_stderr(TemporaryFile()):
- exec_command.exec_command("cd '.'")
+ with assert_warns(DeprecationWarning):
+ exec_command.exec_command("cd '.'")
def test_exec_command_stderr():
# Test posix version:
with redirect_stdout(TemporaryFile(mode='w+')):
with redirect_stderr(StringIO()):
- exec_command.exec_command("cd '.'")
+ with assert_warns(DeprecationWarning):
+ exec_command.exec_command("cd '.'")
if os.name == 'posix':
# Test general (non-posix) version:
with emulate_nonposix():
with redirect_stdout(TemporaryFile()):
with redirect_stderr(StringIO()):
- exec_command.exec_command("cd '.'")
+ with assert_warns(DeprecationWarning):
+ exec_command.exec_command("cd '.'")
class TestExecCommand(object):
@@ -205,11 +209,12 @@ class TestExecCommand(object):
def test_basic(self):
with redirect_stdout(StringIO()):
with redirect_stderr(StringIO()):
- if os.name == "posix":
- self.check_posix(use_tee=0)
- self.check_posix(use_tee=1)
- elif os.name == "nt":
- self.check_nt(use_tee=0)
- self.check_nt(use_tee=1)
- self.check_execute_in(use_tee=0)
- self.check_execute_in(use_tee=1)
+ with assert_warns(DeprecationWarning):
+ if os.name == "posix":
+ self.check_posix(use_tee=0)
+ self.check_posix(use_tee=1)
+ elif os.name == "nt":
+ self.check_nt(use_tee=0)
+ self.check_nt(use_tee=1)
+ self.check_execute_in(use_tee=0)
+ self.check_execute_in(use_tee=1)