diff options
author | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-07-22 12:15:29 +0200 |
---|---|---|
committer | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-07-22 12:15:29 +0200 |
commit | 7c0cfe7a3e4123bbb66f540e829e98673ca1ed7f (patch) | |
tree | 692c7a7de9c1876f3d406e48d9c1f8ce718dd0d6 | |
parent | 312789e3521d8eaa619fee8cbadb01d09eb64cf0 (diff) | |
download | python-setuptools-git-7c0cfe7a3e4123bbb66f540e829e98673ca1ed7f.tar.gz |
Issue #27472: Add test.support.unix_shell as the path to the default shell.
-rw-r--r-- | tests/test_spawn.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_spawn.py b/tests/test_spawn.py index f507ef77..5edc24a3 100644 --- a/tests/test_spawn.py +++ b/tests/test_spawn.py @@ -1,7 +1,8 @@ """Tests for distutils.spawn.""" import unittest +import sys import os -from test.support import run_unittest +from test.support import run_unittest, unix_shell from distutils.spawn import _nt_quote_args from distutils.spawn import spawn @@ -29,9 +30,9 @@ class SpawnTestCase(support.TempdirManager, # creating something executable # through the shell that returns 1 - if os.name == 'posix': + if sys.platform != 'win32': exe = os.path.join(tmpdir, 'foo.sh') - self.write_file(exe, '#!/bin/sh\nexit 1') + self.write_file(exe, '#!%s\nexit 1' % unix_shell) else: exe = os.path.join(tmpdir, 'foo.bat') self.write_file(exe, 'exit 1') @@ -40,9 +41,9 @@ class SpawnTestCase(support.TempdirManager, self.assertRaises(DistutilsExecError, spawn, [exe]) # now something that works - if os.name == 'posix': + if sys.platform != 'win32': exe = os.path.join(tmpdir, 'foo.sh') - self.write_file(exe, '#!/bin/sh\nexit 0') + self.write_file(exe, '#!%s\nexit 0' % unix_shell) else: exe = os.path.join(tmpdir, 'foo.bat') self.write_file(exe, 'exit 0') |