Skip to content

Commit

Permalink
TST: skip general test on non-posix platforms
Browse files Browse the repository at this point in the history
Add a comment explaining the issue.
  • Loading branch information
certik committed Mar 10, 2013
1 parent 36c4321 commit 5099683
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions numpy/distutils/tests/test_exec_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,30 @@ 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:
with redirect_stdout(TemporaryFile()):
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 '.'")

0 comments on commit 5099683

Please sign in to comment.