← Back to team overview

dulwich-users team mailing list archive

[PATCH 2/4] Use HTTPGitRequestHandler for test_web.

 

From: Dave Borowitz <dborowitz@xxxxxxxxxx>

This quiets up the tests by keeping logging output from going to stderr.
It is still trapped by nose and printed on failure, so this should not
hurt debugging significantly.

Change-Id: Ibf7b94a0986bf32939c2d846691d74fcdc11fe36
---
 NEWS                             |    2 ++
 dulwich/tests/compat/test_web.py |    7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 0855788..895658d 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,8 @@
 
   * Add a MemoryRepo that stores everything in memory. (Dave Borowitz)
 
+  * Quiet logging output from web tests. (Dave Borowitz)
+
  CLEANUP
 
   * Clean up file headers. (Dave Borowitz)
diff --git a/dulwich/tests/compat/test_web.py b/dulwich/tests/compat/test_web.py
index d47b718..2c228d4 100644
--- a/dulwich/tests/compat/test_web.py
+++ b/dulwich/tests/compat/test_web.py
@@ -27,6 +27,7 @@ On *nix, you can kill the tests with Ctrl-Z, "kill %".
 import threading
 from wsgiref import simple_server
 
+import dulwich
 from dulwich.server import (
     DictBackend,
     )
@@ -35,6 +36,7 @@ from dulwich.tests import (
     )
 from dulwich.web import (
     HTTPGitApplication,
+    HTTPGitRequestHandler,
     )
 
 from server_utils import (
@@ -72,8 +74,9 @@ class WebTests(ServerTests):
     def _start_server(self, repo):
         backend = DictBackend({'/': repo})
         app = self._make_app(backend)
-        dul_server = simple_server.make_server('localhost', 0, app,
-                                               server_class=WSGIServer)
+        dul_server = simple_server.make_server(
+          'localhost', 0, app, server_class=WSGIServer,
+          handler_class=HTTPGitRequestHandler)
         threading.Thread(target=dul_server.serve_forever).start()
         self._server = dul_server
         _, port = dul_server.socket.getsockname()
-- 
1.7.0.4




References