diff options
author | Éric Araujo <merwok@netwok.org> | 2011-09-02 22:28:43 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-09-02 22:28:43 (GMT) |
commit | 32e2915da5ab7c59e8cd0da68df9c8775ab4353c (patch) | |
tree | 929c64800b9fb3e04128d52ddd71d500cadaaf57 /Lib/distutils/tests | |
parent | d9e1789364ede11e1d48b7ba1afe0369c78c6424 (diff) | |
download | cpython-32e2915da5ab7c59e8cd0da68df9c8775ab4353c.zip cpython-32e2915da5ab7c59e8cd0da68df9c8775ab4353c.tar.gz cpython-32e2915da5ab7c59e8cd0da68df9c8775ab4353c.tar.bz2 |
Enable catching WARN-level logging messages in distutils' test_sdist
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r-- | 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 index f34f786..f9e28c8 100644 --- a/Lib/distutils/tests/test_sdist.py +++ b/Lib/distutils/tests/test_sdist.py @@ -78,9 +78,6 @@ class SDistTestCase(PyPIRCCommandTestCase): 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 @@ class SDistTestCase(PyPIRCCommandTestCase): # 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 @@ class SDistTestCase(PyPIRCCommandTestCase): 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): |