diff options
| author | ?ric Araujo <merwok@netwok.org> | 2011-02-10 00:51:42 +0100 |
|---|---|---|
| committer | ?ric Araujo <merwok@netwok.org> | 2011-02-10 00:51:42 +0100 |
| commit | 37d72aef1b216abd0840afd73c114bad25621a39 (patch) | |
| tree | f6e479ad1ee4292eccd68aa9b7f120315a143457 /distutils2/tests/test_command_sdist.py | |
| parent | b1bd0f37c556fd24b8cb45cf9d8989a61224144f (diff) | |
| download | disutils2-37d72aef1b216abd0840afd73c114bad25621a39.tar.gz | |
Use lazy form in logging calls, again.
Logging calls have the signature (msg, *args, **kwargs) so that the
%-formatting can be delayed until it is needed. Logger objects also have an
isEnabledFor method that can be used to isolate expensive code.
Next steps: use only one of d2.logger methods or logging module functions;
use a proper handler in our test machinery instead of monkey-patching; remove
cmd.warn and cmd.announce and use logging instead. TODOs have been added in
the modules and on the wiki.
Diffstat (limited to 'distutils2/tests/test_command_sdist.py')
| -rw-r--r-- | distutils2/tests/test_command_sdist.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/distutils2/tests/test_command_sdist.py b/distutils2/tests/test_command_sdist.py index cdb0595..4f74876 100644 --- a/distutils2/tests/test_command_sdist.py +++ b/distutils2/tests/test_command_sdist.py @@ -95,9 +95,6 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, 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, "requires zlib") @@ -251,7 +248,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, cmd.ensure_finalized() cmd.run() warnings = self.get_logs(logging.WARN) - self.assertEqual(len(warnings), 1) + self.assertEqual(len(warnings), 2) # trying with a complete set of metadata self.clear_logs() @@ -263,7 +260,8 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, # removing manifest generated warnings warnings = [warn for warn in warnings if not warn.endswith('-- skipping')] - self.assertEqual(len(warnings), 0) + # the remaining warning is about the use of the default file list + self.assertEqual(len(warnings), 1) def test_show_formats(self): |
