From 5099683c351929e938985fd770b0a03cf7285ecb Mon Sep 17 00:00:00 2001 From: Ondrej Certik Date: Sun, 10 Mar 2013 15:31:07 +0100 Subject: TST: skip general test on non-posix platforms Add a comment explaining the issue. --- numpy/distutils/tests/test_exec_command.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'numpy/distutils/tests') diff --git a/numpy/distutils/tests/test_exec_command.py b/numpy/distutils/tests/test_exec_command.py index e9916039f..d23a4485a 100644 --- a/numpy/distutils/tests/test_exec_command.py +++ b/numpy/distutils/tests/test_exec_command.py @@ -52,16 +52,20 @@ def test_exec_command_stdout(): # method. This is tested here, with a do-nothing command that fails if the # presence of fileno() is assumed in exec_command. + # The code has a special case for posix systems, so if we are on posix test + # both that the special case works and that the generic code works. + # Test posix version: with redirect_stdout(StringIO.StringIO()): with redirect_stderr(TemporaryFile()): exec_command.exec_command("cd '.'") - # Test non-posix version: - with emulate_nonposix(): - with redirect_stdout(StringIO.StringIO()): - with redirect_stderr(TemporaryFile()): - exec_command.exec_command("cd '.'") + if os.name == 'posix': + # Test general (non-posix) version: + with emulate_nonposix(): + with redirect_stdout(StringIO.StringIO()): + with redirect_stderr(TemporaryFile()): + exec_command.exec_command("cd '.'") def test_exec_command_stderr(): # Test posix version: @@ -69,8 +73,9 @@ def test_exec_command_stderr(): with redirect_stderr(StringIO.StringIO()): exec_command.exec_command("cd '.'") - # Test non-posix version: - with emulate_nonposix(): - with redirect_stdout(TemporaryFile()): - with redirect_stderr(StringIO.StringIO()): - 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.StringIO()): + exec_command.exec_command("cd '.'") -- cgit v1.2.1