소스 검색

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 년 전
부모
커밋
83acb016e5
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()