Merged revisions 73864 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73864 | tarek.ziade | 2009-07-06 14:50:46 +0200 (Mon, 06 Jul 2009) | 1 line

  Fixed #6377: distutils compiler switch ignored (and added a deprecation warning if compiler is not used as supposed = a string option)
........
This commit is contained in:
Tarek Ziadé 2009-07-06 13:52:17 +00:00
parent 47137250ff
commit dd07ebb44a
4 changed files with 119 additions and 67 deletions

View file

@ -3,6 +3,9 @@ import os
import tempfile
import shutil
from io import StringIO
import warnings
from test.support import check_warnings
from test.support import captured_stdout
from distutils.core import Extension, Distribution
from distutils.command.build_ext import build_ext
@ -395,6 +398,17 @@ class BuildExtTestCase(TempdirManager,
wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap.so')
self.assertEquals(wanted, path)
def test_compiler_deprecation_warning(self):
dist = Distribution()
cmd = build_ext(dist)
with check_warnings() as w:
warnings.simplefilter("always")
cmd.compiler = object()
self.assertEquals(len(w.warnings), 1)
cmd.compile = 'unix'
self.assertEquals(len(w.warnings), 1)
def test_suite():
src = _get_source_filename()
if not os.path.exists(src):