diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-09-21 13:55:19 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-09-21 13:55:19 (GMT) |
commit | 31d4607db195a0facc48e1b9095260a146097800 (patch) | |
tree | 080e0463bd804bdb8fd2673f05fd606af6f95474 /Lib/distutils/tests | |
parent | e7631191b0051af2ac1ed8f6121b548545540c0f (diff) | |
download | cpython-31d4607db195a0facc48e1b9095260a146097800.zip cpython-31d4607db195a0facc48e1b9095260a146097800.tar.gz cpython-31d4607db195a0facc48e1b9095260a146097800.tar.bz2 |
Merged revisions 74994,74997 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74994 | tarek.ziade | 2009-09-21 15:41:08 +0200 (Mon, 21 Sep 2009) | 1 line
#6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
........
r74997 | tarek.ziade | 2009-09-21 15:49:57 +0200 (Mon, 21 Sep 2009) | 1 line
forgot to commit a file in previous commit (r74994, issue #6954)
........
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r-- | Lib/distutils/tests/support.py | 3 | ||||
-rw-r--r-- | Lib/distutils/tests/test_dist.py | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index 1255413..ea12211 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -4,6 +4,7 @@ import shutil import tempfile from distutils import log +from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL from distutils.core import Distribution from test.support import EnvironmentVarGuard @@ -25,6 +26,8 @@ class LoggingSilencer(object): super().tearDown() def _log(self, level, msg, args): + if level not in (DEBUG, INFO, WARN, ERROR, FATAL): + raise ValueError('%s wrong log level' % str(level)) self.logs.append((level, msg, args)) def get_logs(self, *levels): diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py index 91297f0..799b0c0 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -171,6 +171,13 @@ class DistributionTestCase(support.LoggingSilencer, self.assertEquals(cmds, ['distutils.command', 'one', 'two']) + def test_announce(self): + # make sure the level is known + dist = Distribution() + args = ('ok',) + kwargs = {'level': 'ok2'} + self.assertRaises(ValueError, dist.announce, args, kwargs) + class MetadataTestCase(support.TempdirManager, support.EnvironGuard, unittest.TestCase): |