diff options
author | mattip <matti.picus@gmail.com> | 2019-01-30 13:01:21 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-03-10 12:19:16 +0200 |
commit | be0803611defdad708eb3e00d7f81846f5c1f436 (patch) | |
tree | 2c3feb4f8ba56c516c9ea571de7643bfd36f7c6e /numpy/distutils/tests/test_exec_command.py | |
parent | bef927157ffee26ba8af19c773c18b0dbb1897ad (diff) | |
download | numpy-be0803611defdad708eb3e00d7f81846f5c1f436.tar.gz |
DEP: deprecate exec_command
Diffstat (limited to 'numpy/distutils/tests/test_exec_command.py')
-rw-r--r-- | numpy/distutils/tests/test_exec_command.py | 31 |
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) |