]> granicus.if.org Git - python/commitdiff
Stop test_xmlrpc from writing to sys.stderr (#3359)
authorChristian Heimes <christian@python.org>
Wed, 6 Sep 2017 04:43:46 +0000 (21:43 -0700)
committerGitHub <noreply@github.com>
Wed, 6 Sep 2017 04:43:46 +0000 (21:43 -0700)
One test case of test_xmlrpc uses HTTPServer with a subclass of
BaseHTTPRequestHandler. The BaseRequestHandler class logs to
sys.stderr by default. Override log_message() to not clobber
test output.

Signed-off-by: Christian Heimes <christian@python.org>
Lib/test/test_xmlrpc.py

index 74a46ba883a911e1f4bda21bb833b8011947220d..a609eef503f5c3b6c90275a6aa535381267422e8 100644 (file)
@@ -328,6 +328,10 @@ class XMLRPCTestCase(unittest.TestCase):
                 self.handled = True
                 self.close_connection = False
 
+            def log_message(self, format, *args):
+                # don't clobber sys.stderr
+                pass
+
         def run_server():
             server.socket.settimeout(float(1))  # Don't hang if client fails
             server.handle_request()  # First request and attempt at second