summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-07-22 09:56:36 (GMT)
committerNed Deily <nad@acm.org>2012-07-22 09:56:36 (GMT)
commitc7a5a76b1ebaeb07617f17fd1952c871e7c9e3b4 (patch)
treee28cd13c1f76895b61e4144df54681d3e6e8aa56 /Lib/distutils
parent2c80e120a95e7ce38e65cafc7e1cb2a76046c0e0 (diff)
downloadcpython-c7a5a76b1ebaeb07617f17fd1952c871e7c9e3b4.zip
cpython-c7a5a76b1ebaeb07617f17fd1952c871e7c9e3b4.tar.gz
cpython-c7a5a76b1ebaeb07617f17fd1952c871e7c9e3b4.tar.bz2
Issue #15184: Some config variables in test_sysconfig_module
may differ between sysconfig and distutils.sysconfig due to compiler customizations on OS X. For now, move those vars into a separate test and skip if the customization has taken place in distutils. The long-term solution is to eliminate having two sysconfig modules.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/tests/test_sysconfig.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index fbe26bf..545ef3b 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -102,7 +102,27 @@ class SysconfigTestCase(support.EnvironGuard,
import sysconfig as global_sysconfig
self.assertEqual(global_sysconfig.get_config_var('CFLAGS'), sysconfig.get_config_var('CFLAGS'))
self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'), sysconfig.get_config_var('LDFLAGS'))
- self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),sysconfig.get_config_var('LDSHARED'))
+
+ @unittest.skipIf(sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'),'compiler flags customized')
+ def test_sysconfig_compiler_vars(self):
+ # On OS X, binary installers support extension module building on
+ # various levels of the operating system with differing Xcode
+ # configurations. This requires customization of some of the
+ # compiler configuration directives to suit the environment on
+ # the installed machine. Some of these customizations may require
+ # running external programs and, so, are deferred until needed by
+ # the first extension module build. With Python 3.3, only
+ # the Distutils version of sysconfig is used for extension module
+ # builds, which happens earlier in the Distutils tests. This may
+ # cause the following tests to fail since no tests have caused
+ # the global version of sysconfig to call the customization yet.
+ # The solution for now is to simply skip this test in this case.
+ # The longer-term solution is to only have one version of sysconfig.
+
+ import sysconfig as global_sysconfig
+ if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'):
+ return
+ self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), sysconfig.get_config_var('LDSHARED'))
self.assertEqual(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC'))