aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/_distutils/tests/test_spawn.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-07-08 20:24:44 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-07-08 20:24:44 -0400
commit461c8f4892f1fbb74448ee4323ab5c05532a4072 (patch)
tree432df36cde1809b1a1d81e91a34c770e8e5add79 /setuptools/_distutils/tests/test_spawn.py
parentaff64ae89e00e25fb3868bf528a14c18e7af0cf4 (diff)
parentbbe8e80bcbafff8cf3d135d17a8526c8ac5f4b27 (diff)
downloadexternal_python_setuptools-461c8f4892f1fbb74448ee4323ab5c05532a4072.tar.gz
external_python_setuptools-461c8f4892f1fbb74448ee4323ab5c05532a4072.tar.bz2
external_python_setuptools-461c8f4892f1fbb74448ee4323ab5c05532a4072.zip
Merge commit 'bbe8e80bcbafff8cf3d135d17a8526c8ac5f4b27' of https://github.com/pypa/distutils into refresh-distutils
Diffstat (limited to 'setuptools/_distutils/tests/test_spawn.py')
-rw-r--r--setuptools/_distutils/tests/test_spawn.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/setuptools/_distutils/tests/test_spawn.py b/setuptools/_distutils/tests/test_spawn.py
index 704019a1..f620da78 100644
--- a/setuptools/_distutils/tests/test_spawn.py
+++ b/setuptools/_distutils/tests/test_spawn.py
@@ -4,9 +4,9 @@ import stat
import sys
import unittest.mock
from test.support import run_unittest
-from test import support as test_support
from .py35compat import unix_shell
+from . import py38compat as os_helper
from distutils.spawn import find_executable
from distutils.spawn import spawn
@@ -46,9 +46,9 @@ class SpawnTestCase(support.TempdirManager,
spawn([exe]) # should work without any error
def test_find_executable(self):
- with test_support.temp_dir() as tmp_dir:
+ with os_helper.temp_dir() as tmp_dir:
# use TESTFN to get a pseudo-unique filename
- program_noeext = test_support.TESTFN
+ program_noeext = os_helper.TESTFN
# Give the temporary program an ".exe" suffix for all.
# It's needed on Windows and not harmful on other platforms.
program = program_noeext + ".exe"
@@ -68,7 +68,7 @@ class SpawnTestCase(support.TempdirManager,
self.assertEqual(rv, filename)
# test find in the current directory
- with test_support.change_cwd(tmp_dir):
+ with os_helper.change_cwd(tmp_dir):
rv = find_executable(program)
self.assertEqual(rv, program)
@@ -78,7 +78,7 @@ class SpawnTestCase(support.TempdirManager,
self.assertIsNone(rv)
# PATH='': no match, except in the current directory
- with test_support.EnvironmentVarGuard() as env:
+ with os_helper.EnvironmentVarGuard() as env:
env['PATH'] = ''
with unittest.mock.patch('distutils.spawn.os.confstr',
return_value=tmp_dir, create=True), \
@@ -88,12 +88,12 @@ class SpawnTestCase(support.TempdirManager,
self.assertIsNone(rv)
# look in current directory
- with test_support.change_cwd(tmp_dir):
+ with os_helper.change_cwd(tmp_dir):
rv = find_executable(program)
self.assertEqual(rv, program)
# PATH=':': explicitly looks in the current directory
- with test_support.EnvironmentVarGuard() as env:
+ with os_helper.EnvironmentVarGuard() as env:
env['PATH'] = os.pathsep
with unittest.mock.patch('distutils.spawn.os.confstr',
return_value='', create=True), \
@@ -102,12 +102,12 @@ class SpawnTestCase(support.TempdirManager,
self.assertIsNone(rv)
# look in current directory
- with test_support.change_cwd(tmp_dir):
+ with os_helper.change_cwd(tmp_dir):
rv = find_executable(program)
self.assertEqual(rv, program)
# missing PATH: test os.confstr("CS_PATH") and os.defpath
- with test_support.EnvironmentVarGuard() as env:
+ with os_helper.EnvironmentVarGuard() as env:
env.pop('PATH', None)
# without confstr
@@ -129,7 +129,7 @@ class SpawnTestCase(support.TempdirManager,
def test_spawn_missing_exe(self):
with self.assertRaises(DistutilsExecError) as ctx:
spawn(['does-not-exist'])
- assert 'command does-no-exist failed' in str(ctx)
+ self.assertIn("command 'does-not-exist' failed", str(ctx.exception))
def test_suite():