]> granicus.if.org Git - python/commitdiff
Document autoflushing in packaging.test.support.LoggingCatcher.get_logs.
authorÉric Araujo <merwok@netwok.org>
Fri, 3 Jun 2011 15:28:23 +0000 (17:28 +0200)
committerÉric Araujo <merwok@netwok.org>
Fri, 3 Jun 2011 15:28:23 +0000 (17:28 +0200)
I’m afraid my docstring is not as clear as it should be, but I can’t
find a concise way of describing what the code does.  Suggestions for
improvements welcome.

Lib/packaging/tests/support.py

index ae65a1db3b58bdb2d7c277c9b3ae39adbe4f2147..501f1260a36bb5212292c2e1c1d71ddac58216e7 100644 (file)
@@ -65,7 +65,10 @@ class LoggingCatcher:
     configured to record all messages logged to the 'packaging' logger.
 
     Use get_logs to retrieve messages and self.loghandler.flush to discard
-    them.
+    them.  get_logs automatically flushes the logs; if you test code that
+    generates logging messages but don't use get_logs, you have to flush
+    manually before doing other checks on logging message, otherwise you
+    will get irrelevant results.  See example in test_command_check.
     """
 
     def setUp(self):