]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add trollius (py2 backport of asyncio) to tox config.
authorBen Darnell <ben@bendarnell.com>
Tue, 7 Jan 2014 06:14:37 +0000 (01:14 -0500)
committerBen Darnell <ben@bendarnell.com>
Tue, 7 Jan 2014 06:14:37 +0000 (01:14 -0500)
This passes the twisted integration tests but currently has some issues
with pycurl.

tornado/platform/asyncio.py
tornado/test/twisted_test.py
tox.ini

index bc5c2f27d3f1266ed869509595a090c697f02cd4..162b36735d564ac829c04bb552f400ce12dff190 100644 (file)
@@ -36,7 +36,10 @@ class BaseAsyncIOLoop(IOLoop):
         for fd in list(self.handlers):
             self.remove_handler(fd)
             if all_fds:
-                os.close(fd)
+                try:
+                    os.close(fd)
+                except OSError:
+                    pass
         if self.close_loop:
             self.asyncio_loop.close()
 
index 003b539d4beade2b80d22b73615fd9ad4ef4f7e0..2922a61e000507536aa5546cff0748bf7aab4c38 100644 (file)
@@ -470,9 +470,8 @@ if have_twisted:
         'twisted.internet.test.test_core.ObjectModelIntegrationTest': [],
         'twisted.internet.test.test_core.SystemEventTestsBuilder': [
             'test_iterate',  # deliberately not supported
-            'test_runAfterCrash',  # fails because TwistedIOLoop uses the global reactor
-        ] if issubclass(IOLoop.configured_class(), TwistedIOLoop) else [
-            'test_iterate',  # deliberately not supported
+            # Fails on TwistedIOLoop and AsyncIOLoop.
+            'test_runAfterCrash',
         ],
         'twisted.internet.test.test_fdset.ReactorFDSetTestsBuilder': [
             "test_lostFileDescriptor",  # incompatible with epoll and kqueue
diff --git a/tox.ini b/tox.ini
index 5c68e8ec909fe0b2780192edeaf79addbc9a3200..43756b72402cf58ccf878bccd50657b042fb8c7e 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -10,7 +10,8 @@
 [tox]
 # "-full" variants include optional dependencies, to ensure
 # that things work both in a bare install and with all the extras.
-envlist = py27-full, py27-curl, py32-full, pypy, py26, py26-full, py27, py32, py32-utf8, py33, py27-opt, py32-opt, pypy-full, py27-select, py27-monotonic, py33-monotonic, py33-asyncio, py27-twisted, py27-threadedresolver, py27-twistedresolver, py27-twistedlayered, py27-caresresolver, py32-caresresolver, py27-locale, py27-docs
+envlist = py27-full, py27-curl, py32-full, pypy, py26, py26-full, py27, py32, py32-utf8, py33, py27-opt, py32-opt, pypy-full, py27-select, py27-monotonic, py33-monotonic, py33-asyncio, py27-twisted, py27-threadedresolver, py27-twistedresolver, py27-twistedlayered, py27-caresresolver, py32-caresresolver, py27-locale, py27-trollius, py27-docs
+
 [testenv]
 commands = python -m tornado.test.runtests {posargs:}
 
@@ -207,6 +208,18 @@ deps =
      twisted>=12.0.0
 commands = python -O -m tornado.test.runtests {posargs:}
 
+# Trollius is the py2.7 backport of asyncio.
+[testenv:py27-trollius]
+basepython = python2.7
+commands = python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop {posargs:}
+# Pycurl tests currently fail with trollius.
+deps =
+     futures
+     mock
+     # pycurl
+     trollius>=0.1.1
+     twisted
+
 [testenv:py32-opt]
 basepython = python3.2
 commands = python -O -m tornado.test.runtests {posargs:}