summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_sysconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/tests/test_sysconfig.py')
-rw-r--r--Lib/distutils/tests/test_sysconfig.py36
1 files changed, 6 insertions, 30 deletions
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index edc755e..e7df803 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -4,7 +4,6 @@ import test
import unittest
from distutils import sysconfig
-from distutils.ccompiler import get_default_compiler
from distutils.tests import support
from test.support import TESTFN, run_unittest
@@ -26,10 +25,7 @@ class SysconfigTestCase(support.EnvironGuard,
elif os.path.isdir(TESTFN):
shutil.rmtree(TESTFN)
- def test_get_config_h_filename(self):
- config_h = sysconfig.get_config_h_filename()
- self.assertTrue(os.path.isfile(config_h), config_h)
-
+ @support.capture_warnings
def test_get_python_lib(self):
lib_dir = sysconfig.get_python_lib()
# XXX doesn't work on Linux when Python was never installed before
@@ -37,7 +33,11 @@ class SysconfigTestCase(support.EnvironGuard,
# test for pythonxx.lib?
self.assertNotEqual(sysconfig.get_python_lib(),
sysconfig.get_python_lib(prefix=TESTFN))
+ _sysconfig = __import__('sysconfig')
+ res = sysconfig.get_python_lib(True, True)
+ self.assertEquals(_sysconfig.get_path('platstdlib'), res)
+ @support.capture_warnings
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
@@ -47,31 +47,7 @@ class SysconfigTestCase(support.EnvironGuard,
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.assertTrue(isinstance(cvars, dict))
- self.assertTrue(cvars)
-
- def test_customize_compiler(self):
-
- # not testing if default compiler is not unix
- if get_default_compiler() != 'unix':
- return
-
- os.environ['AR'] = 'my_ar'
- os.environ['ARFLAGS'] = '-arflags'
-
- # make sure AR gets caught
- class compiler:
- compiler_type = 'unix'
-
- def set_executables(self, **kw):
- self.exes = kw
-
- comp = compiler()
- sysconfig.customize_compiler(comp)
- self.assertEquals(comp.exes['archiver'], 'my_ar -arflags')
-
+ @support.capture_warnings
def test_parse_makefile_base(self):
self.makefile = TESTFN
fd = open(self.makefile, 'w')