]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix singledispatch for asyncio on py26. 1557/head
authorBen Darnell <ben@bendarnell.com>
Sun, 18 Oct 2015 21:08:00 +0000 (23:08 +0200)
committerBen Darnell <ben@bendarnell.com>
Sun, 18 Oct 2015 21:12:50 +0000 (23:12 +0200)
Disable singledispatch tests for twisted on py26 because it doesn't
work.

setup.py
tornado/test/twisted_test.py

index c63e14b44a4bb7e81dbb507814290a927acb2621..d2467454822aca7f54f7b612c1d518e53d876bd9 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -122,6 +122,9 @@ if (platform.python_implementation() == 'CPython' and
 if setuptools is not None:
     # If setuptools is not available, you're on your own for dependencies.
     install_requires = []
+    if sys.version_info < (2, 7):
+        # Only needed indirectly, for singledispatch.
+        install_requires.append('ordereddict')
     if sys.version_info < (3, 2):
         install_requires.append('backports.ssl_match_hostname')
     if sys.version_info < (3, 4):
index 8389e60bbf63d33c02f7b1559d5e2857eebfe503..1cff30ecbb6c82a7aa6c8044f80092fb0496d9f0 100644 (file)
@@ -72,6 +72,9 @@ from tornado.web import RequestHandler, Application
 skipIfNoTwisted = unittest.skipUnless(have_twisted,
                                       "twisted module not present")
 
+skipIfPy26 = unittest.skipIf(sys.version_info < (2, 7),
+                             "twisted incompatible with singledispatch in py26")
+
 
 def save_signal_handlers():
     saved = {}
@@ -492,6 +495,7 @@ class CompatibilityTests(unittest.TestCase):
             'http://127.0.0.1:%d' % self.tornado_port, self.run_reactor)
         self.assertEqual(response, 'Hello from tornado!')
 
+    @skipIfPy26
     def testTornadoServerTwistedCoroutineClientIOLoop(self):
         self.start_tornado_server()
         response = self.twisted_coroutine_fetch(
@@ -500,6 +504,7 @@ class CompatibilityTests(unittest.TestCase):
 
 
 @skipIfNoTwisted
+@skipIfPy26
 class ConvertDeferredTest(unittest.TestCase):
     def test_success(self):
         @inlineCallbacks