[Python-checkins] cpython (3.2): Enable catching WARN-level logging messages in distutils' test_sdist
eric.araujo
python-checkins at python.org
Mon Sep 5 17:46:06 CEST 2011
http://hg.python.org/cpython/rev/a3e492ed389e
changeset: 72275:a3e492ed389e
branch: 3.2
parent: 72194:83c16d258fec
user: Éric Araujo <merwok at netwok.org>
date: Sat Sep 03 00:28:43 2011 +0200
summary:
Enable catching WARN-level logging messages in distutils' test_sdist
files:
Lib/distutils/tests/test_sdist.py | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -78,9 +78,6 @@
dist.include_package_data = True
cmd = sdist(dist)
cmd.dist_dir = 'dist'
- def _warn(*args):
- pass
- cmd.warn = _warn
return dist, cmd
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
@@ -235,7 +232,8 @@
# with the `check` subcommand
cmd.ensure_finalized()
cmd.run()
- warnings = self.get_logs(WARN)
+ warnings = [msg for msg in self.get_logs(WARN) if
+ msg.startswith('warning: check:')]
self.assertEqual(len(warnings), 2)
# trying with a complete set of metadata
@@ -244,7 +242,8 @@
cmd.ensure_finalized()
cmd.metadata_check = 0
cmd.run()
- warnings = self.get_logs(WARN)
+ warnings = [msg for msg in self.get_logs(WARN) if
+ msg.startswith('warning: check:')]
self.assertEqual(len(warnings), 0)
def test_check_metadata_deprecated(self):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list