From 35467008986bc73f6d6242ebb115a3bce8f725a6 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 18 Oct 2015 23:08:00 +0200 Subject: [PATCH] Fix singledispatch for asyncio on py26. Disable singledispatch tests for twisted on py26 because it doesn't work. --- setup.py | 3 +++ tornado/test/twisted_test.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/setup.py b/setup.py index c63e14b44..d24674548 100644 --- 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): diff --git a/tornado/test/twisted_test.py b/tornado/test/twisted_test.py index 8389e60bb..1cff30ecb 100644 --- a/tornado/test/twisted_test.py +++ b/tornado/test/twisted_test.py @@ -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 -- 2.47.2