summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier de Gaye <xdegaye@users.sourceforge.net>2016-11-17 09:01:58 +0100
committerXavier de Gaye <xdegaye@users.sourceforge.net>2016-11-17 09:01:58 +0100
commit54d05ca8079f6efaefffa708e38287b1ada97e02 (patch)
tree1138f366df6f1a1b1bc5fdb1c182fd53d067385b
parent30ab4c4beaeac2f61a81b6b9a326a6eab5b14a52 (diff)
parent874f6ddbb74da00b9b323721cd79509fc1d5487b (diff)
downloadpython-setuptools-git-54d05ca8079f6efaefffa708e38287b1ada97e02.tar.gz
Issue 26931: Merge 3.6
-rw-r--r--tests/test_build_clib.py20
-rw-r--r--tests/test_build_ext.py6
-rw-r--r--tests/test_config_cmd.py5
-rw-r--r--tests/test_install.py4
-rw-r--r--tests/test_sysconfig.py9
5 files changed, 20 insertions, 24 deletions
diff --git a/tests/test_build_clib.py b/tests/test_build_clib.py
index acc99e78..85d09906 100644
--- a/tests/test_build_clib.py
+++ b/tests/test_build_clib.py
@@ -3,7 +3,7 @@ import unittest
import os
import sys
-from test.support import run_unittest
+from test.support import run_unittest, missing_compiler_executable
from distutils.command.build_clib import build_clib
from distutils.errors import DistutilsSetupError
@@ -116,19 +116,11 @@ class BuildCLibTestCase(support.TempdirManager,
cmd.build_temp = build_temp
cmd.build_clib = build_temp
- # before we run the command, we want to make sure
- # all commands are present on the system
- # by creating a compiler and checking its executables
- from distutils.ccompiler import new_compiler
- from distutils.sysconfig import customize_compiler
-
- compiler = new_compiler()
- customize_compiler(compiler)
- for ccmd in compiler.executables.values():
- if ccmd is None:
- continue
- if find_executable(ccmd[0]) is None:
- self.skipTest('The %r command is not found' % ccmd[0])
+ # Before we run the command, we want to make sure
+ # all commands are present on the system.
+ ccmd = missing_compiler_executable()
+ if ccmd is not None:
+ self.skipTest('The %r command is not found' % ccmd)
# this should work
cmd.run()
diff --git a/tests/test_build_ext.py b/tests/test_build_ext.py
index 6be0ca23..be7f5f38 100644
--- a/tests/test_build_ext.py
+++ b/tests/test_build_ext.py
@@ -41,6 +41,9 @@ class BuildExtTestCase(TempdirManager,
return build_ext(*args, **kwargs)
def test_build_ext(self):
+ cmd = support.missing_compiler_executable()
+ if cmd is not None:
+ self.skipTest('The %r command is not found' % cmd)
global ALREADY_TESTED
copy_xxmodule_c(self.tmp_dir)
xx_c = os.path.join(self.tmp_dir, 'xxmodule.c')
@@ -295,6 +298,9 @@ class BuildExtTestCase(TempdirManager,
self.assertEqual(cmd.compiler, 'unix')
def test_get_outputs(self):
+ cmd = support.missing_compiler_executable()
+ if cmd is not None:
+ self.skipTest('The %r command is not found' % cmd)
tmp_dir = self.mkdtemp()
c_file = os.path.join(tmp_dir, 'foo.c')
self.write_file(c_file, 'void PyInit_foo(void) {}\n')
diff --git a/tests/test_config_cmd.py b/tests/test_config_cmd.py
index 0c8dbd82..6e566e79 100644
--- a/tests/test_config_cmd.py
+++ b/tests/test_config_cmd.py
@@ -2,7 +2,7 @@
import unittest
import os
import sys
-from test.support import run_unittest
+from test.support import run_unittest, missing_compiler_executable
from distutils.command.config import dump_file, config
from distutils.tests import support
@@ -39,6 +39,9 @@ class ConfigTestCase(support.LoggingSilencer,
@unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
def test_search_cpp(self):
+ cmd = missing_compiler_executable(['preprocessor'])
+ if cmd is not None:
+ self.skipTest('The %r command is not found' % cmd)
pkg_dir, dist = self.create_dist()
cmd = config(dist)
diff --git a/tests/test_install.py b/tests/test_install.py
index 9313330e..287ab198 100644
--- a/tests/test_install.py
+++ b/tests/test_install.py
@@ -17,6 +17,7 @@ from distutils.errors import DistutilsOptionError
from distutils.extension import Extension
from distutils.tests import support
+from test import support as test_support
def _make_ext_name(modname):
@@ -196,6 +197,9 @@ class InstallTestCase(support.TempdirManager,
self.assertEqual(found, expected)
def test_record_extensions(self):
+ cmd = test_support.missing_compiler_executable()
+ if cmd is not None:
+ self.skipTest('The %r command is not found' % cmd)
install_dir = self.mkdtemp()
project_dir, dist = self.create_dist(ext_modules=[
Extension('xx', ['xxmodule.c'])])
diff --git a/tests/test_sysconfig.py b/tests/test_sysconfig.py
index fc4d1de1..fe4a2994 100644
--- a/tests/test_sysconfig.py
+++ b/tests/test_sysconfig.py
@@ -39,15 +39,6 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
self.assertNotEqual(sysconfig.get_python_lib(),
sysconfig.get_python_lib(prefix=TESTFN))
- def test_get_python_inc(self):
- inc_dir = sysconfig.get_python_inc()
- # This is not much of a test. We make sure Python.h exists
- # in the directory returned by get_python_inc() but we don't know
- # it is the correct file.
- self.assertTrue(os.path.isdir(inc_dir), inc_dir)
- python_h = os.path.join(inc_dir, "Python.h")
- self.assertTrue(os.path.isfile(python_h), python_h)
-
def test_get_config_vars(self):
cvars = sysconfig.get_config_vars()
self.assertIsInstance(cvars, dict)