summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-06-03 15:28:23 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-06-03 15:28:23 (GMT)
commit5d5bde1df2e92fcd545baeef4fb212462982e47e (patch)
tree484814b00fdeb989bdacb4d38dfeae366466d53b
parent765e94f80c753cfeb077d8a372483aff4d8f178f (diff)
downloadcpython-5d5bde1df2e92fcd545baeef4fb212462982e47e.zip
cpython-5d5bde1df2e92fcd545baeef4fb212462982e47e.tar.gz
cpython-5d5bde1df2e92fcd545baeef4fb212462982e47e.tar.bz2
Document autoflushing in packaging.test.support.LoggingCatcher.get_logs.
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.
-rw-r--r--Lib/packaging/tests/support.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/packaging/tests/support.py b/Lib/packaging/tests/support.py
index ae65a1d..501f126 100644
--- a/Lib/packaging/tests/support.py
+++ b/Lib/packaging/tests/support.py
@@ -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):