diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index bce034949e0..3c328cc9a64 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.test_support import EnvironmentVarGuard @@ -25,6 +26,8 @@ class LoggingSilencer(object): super(LoggingSilencer, self).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):