Преглед на файлове

Use HTTPGitRequestHandler for test_web.

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.
Dave Borowitz преди 14 години
родител
ревизия
cc114a1fa3
променени са 2 файла, в които са добавени 7 реда и са изтрити 2 реда
  1. 2 0
      NEWS
  2. 5 2
      dulwich/tests/compat/test_web.py

+ 2 - 0
NEWS

@@ -29,6 +29,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)

+ 5 - 2
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()