浏览代码

Update NEWS, README.md to reflect fixing of #295.

Re-enable compat tests for web on Python3.
Jelmer Vernooij 9 年之前
父节点
当前提交
8eb37d3b44
共有 4 个文件被更改,包括 5 次插入12 次删除
  1. 2 0
      NEWS
  2. 0 1
      README.md
  3. 3 9
      dulwich/tests/compat/test_web.py
  4. 0 2
      dulwich/tests/utils.py

+ 2 - 0
NEWS

@@ -15,6 +15,8 @@
     references, making the behaviour more consistent with that of
     references, making the behaviour more consistent with that of
     DiskObjectStore. (Félix Mattrat, Jelmer Vernooij)
     DiskObjectStore. (Félix Mattrat, Jelmer Vernooij)
 
 
+  * Fix ``dulwich.web`` on Python3. (#295, Jonas Haag)
+
  CHANGES
  CHANGES
 
 
   * Drop support for Python 2.6.
   * Drop support for Python 2.6.

+ 0 - 1
README.md

@@ -47,4 +47,3 @@ Supported versions of Python
 ----------------------------
 ----------------------------
 
 
 At the moment, Dulwich supports (and is tested on) CPython 2.6, 2.7, 3.4, 3.5 and Pypy.
 At the moment, Dulwich supports (and is tested on) CPython 2.6, 2.7, 3.4, 3.5 and Pypy.
-The ``dulwich.web`` module is currently broken on Python 3 (issue #295).

+ 3 - 9
dulwich/tests/compat/test_web.py

@@ -37,9 +37,6 @@ from dulwich.tests import (
     SkipTest,
     SkipTest,
     skipIf,
     skipIf,
     )
     )
-from dulwich.tests.utils import (
-    skipIfPY3,
-    )
 from dulwich.web import (
 from dulwich.web import (
     make_wsgi_chain,
     make_wsgi_chain,
     HTTPGitApplication,
     HTTPGitApplication,
@@ -81,7 +78,6 @@ class WebTests(ServerTests):
 
 
 
 
 @skipIf(sys.platform == 'win32', 'Broken on windows, with very long fail time.')
 @skipIf(sys.platform == 'win32', 'Broken on windows, with very long fail time.')
-@skipIfPY3
 class SmartWebTestCase(WebTests, CompatTestCase):
 class SmartWebTestCase(WebTests, CompatTestCase):
     """Test cases for smart HTTP server.
     """Test cases for smart HTTP server.
 
 
@@ -91,7 +87,7 @@ class SmartWebTestCase(WebTests, CompatTestCase):
     min_git_version = (1, 6, 6)
     min_git_version = (1, 6, 6)
 
 
     def _handlers(self):
     def _handlers(self):
-        return {'git-receive-pack': NoSideBand64kReceivePackHandler}
+        return {b'git-receive-pack': NoSideBand64kReceivePackHandler}
 
 
     def _check_app(self, app):
     def _check_app(self, app):
         receive_pack_handler_cls = app.handlers[b'git-receive-pack']
         receive_pack_handler_cls = app.handlers[b'git-receive-pack']
@@ -121,7 +117,6 @@ def patch_capabilities(handler, caps_removed):
 
 
 
 
 @skipIf(sys.platform == 'win32', 'Broken on windows, with very long fail time.')
 @skipIf(sys.platform == 'win32', 'Broken on windows, with very long fail time.')
-@skipIfPY3
 class SmartWebSideBand64kTestCase(SmartWebTestCase):
 class SmartWebSideBand64kTestCase(SmartWebTestCase):
     """Test cases for smart HTTP server with side-band-64k support."""
     """Test cases for smart HTTP server with side-band-64k support."""
 
 
@@ -129,8 +124,8 @@ class SmartWebSideBand64kTestCase(SmartWebTestCase):
     min_git_version = (1, 7, 0, 2)
     min_git_version = (1, 7, 0, 2)
 
 
     def setUp(self):
     def setUp(self):
-        self.o_uph_cap = patch_capabilities(UploadPackHandler, ("no-done",))
-        self.o_rph_cap = patch_capabilities(ReceivePackHandler, ("no-done",))
+        self.o_uph_cap = patch_capabilities(UploadPackHandler, (b"no-done",))
+        self.o_rph_cap = patch_capabilities(ReceivePackHandler, (b"no-done",))
         super(SmartWebSideBand64kTestCase, self).setUp()
         super(SmartWebSideBand64kTestCase, self).setUp()
 
 
     def tearDown(self):
     def tearDown(self):
@@ -167,7 +162,6 @@ class SmartWebSideBand64kNoDoneTestCase(SmartWebTestCase):
 
 
 
 
 @skipIf(sys.platform == 'win32', 'Broken on windows, with very long fail time.')
 @skipIf(sys.platform == 'win32', 'Broken on windows, with very long fail time.')
-@skipIfPY3
 class DumbWebTestCase(WebTests, CompatTestCase):
 class DumbWebTestCase(WebTests, CompatTestCase):
     """Test cases for dumb HTTP server."""
     """Test cases for dumb HTTP server."""
 
 

+ 0 - 2
dulwich/tests/utils.py

@@ -360,5 +360,3 @@ def setup_warning_catcher():
         warnings.showwarning = original_showwarning
         warnings.showwarning = original_showwarning
 
 
     return caught_warnings, restore_showwarning
     return caught_warnings, restore_showwarning
-
-skipIfPY3 = skipIf(sys.version_info[0] == 3, "Feature not yet ported to python3.")