From: Ben Darnell Date: Sun, 18 Oct 2015 21:08:00 +0000 (+0200) Subject: Fix singledispatch for asyncio on py26. X-Git-Tag: v4.3.0b1~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1557%2Fhead;p=thirdparty%2Ftornado.git Fix singledispatch for asyncio on py26. Disable singledispatch tests for twisted on py26 because it doesn't work. --- 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